Eric Blake wrote: > > If you remove this special-casing, one of the tests in the testsuite fails. > > Namely when the first fseek after fflush attempts to position beyond end of > > file. That's something that lseek() does not support, but we are forced to > > used lseek() in this situation, by POSIX. You can try to undo these two > > hunks and fix the resulting test failure differently... > > Huh? "The lseek() function shall allow the file offset to be set beyond > the end of the existing data in the file. If data is later written at > this point, subsequent reads of data in the gap shall return bytes with > the value 0 until data is actually written into the gap." > http://www.opengroup.org/onlinepubs/9699919799/functions/lseek.html
Probably true. Then it must be something instead the streams that gets messed up by this situation. If I remove this special-casing, I get these test failures (on a glibc system): test-ftell.c:97: assertion failed ./test-ftell.sh: line 3: 22277 Abgebrochen ./test-ftell${EXEEXT} 1 < "$srcdir/test-ftell.sh" FAIL: test-ftell.sh test-ftello.c:107: assertion failed ./test-ftello.sh: line 3: 22283 Abgebrochen ./test-ftello${EXEEXT} 1 < "$srcdir/test-ftello.sh" FAIL: test-ftello.sh Bruno