[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fseek failing without fflush?
From: |
Bruno Haible |
Subject: |
Re: fseek failing without fflush? |
Date: |
Tue, 9 Aug 2011 23:45:32 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
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>
- fseek failing without fflush?, John W. Eaton, 2011/08/09
- Re: fseek failing without fflush?, Eric Blake, 2011/08/09
- Re: fseek failing without fflush?, John W. Eaton, 2011/08/09
- Re: fseek failing without fflush?, Eric Blake, 2011/08/09
- Re: fseek failing without fflush?, Eric Blake, 2011/08/09
- Re: fseek failing without fflush?,
Bruno Haible <=
- [PATCH 1/2] fseeko: fix bug on glibc, Eric Blake, 2011/08/09
- [PATCH 2/2] fseeko: remove unneeded hack, Eric Blake, 2011/08/09
- Re: [PATCH 1/2] fseeko: fix bug on glibc, Bruno Haible, 2011/08/09