[PATCH] RE: Testsuite problem

Pétur Runólfsson peturr02@ru.is
Thu Apr 22 16:53:00 GMT 2004


Zack Weinberg wrote: 
> I clearly wasn't paying enough attention here.  Can you please clarify
> why the original patch is incorrect?  I do not see why the change made
> should have caused the write() operation not to fail.

I don't know why it does, but it is pretty clear from the patch that
write() is not failing any more:

   ret = fb.close();
-  VERIFY( ret == NULL );
+  VERIFY( ret != NULL );
   VERIFY( !fb.is_open() );

basic_filebuf::close() is supposed to write out the contents of the
buffer, possibly call codecvt::unshift(), and finally close the file.
If any of the three operations fail, it returns NULL, if all succeed,
it returns this. Since close() isn't returning NULL any more, it follows
that write() must now be succeeding.

Petur



More information about the Libstdc++ mailing list