Hi Eric,

> Found it.  And the fix is embarrassingly simple - we were simply failing 
> to update the stream position to match the fd position:
> 
> @@ -111,6 +107,7 @@ fseeko (FILE *fp, off_t offset, int whence)
> 
>   #if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, 
> BeOS, Haiku, Linux libc5 */
>         fp->_flags &= ~_IO_EOF_SEEN;
> +      fp->_offset = pos;

Yup. I found this solution as well, at the same time.

> And in fact, it turns out I asked Bruno about it a couple years ago!  He 
> had special-cased some code in ftello.c in order to make a test pass 
> under glibc, without understanding the real reason why he was getting 
> the testsuite failures:
> https://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00171.html
> 
> This means that the real fix for this issue should undo the hacks, since 
> the testsuite was already robust enough to catch this problem and we had 
> just hacked around it, rather than having to also worry about enhancing 
> test-ftello.c.  Final patch coming soon.

OK, can we commit the simple one-liner fix nevertheless first, for the
record? And the test case as well? I'm preparing a patch.

Bruno
-- 
In memoriam Franz Jägerstätter <http://en.wikipedia.org/wiki/Franz_Jägerstätter>

Reply via email to