This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] RE: Testsuite problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]