This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] |
On Sun, Nov 25, 2012 at 07:17:06AM +0100, Andreas Jaeger wrote: > With glibc git, I get a test failure in building grep: > > grep-2.14/gnulib-tests> ./test-fwrite > test-fwrite.c:53: assertion failed > Aborted > > This does not seem to occur with glibc 2.16. > Siddhesh, could you check the grep testsuite with your patch for > BZ#11741, please? My patch seems to have exposed what I think is a bug in fwrite implementation. The current assumption in fwrite is that even if _IO_sputn returns EOF, the data is in the buffer and only a flush failed. That assumption is wrong since the flush could have happened in the middle of writing data, which resulted in an EOF. The following patch to fwrite should fix this. The glibc testsuite is still clean with this change. Is this OK for master? Siddhesh ChangeLog: [BZ #11741] * libio/iofwrite (_IO_fwrite): Return 0 on EOF. * libio/iofwrite_u.c (fwrite_unlocked): Likewise.
Attachment:
fwrite-error.patch
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |