bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fseeko bug


From: Eric Blake
Subject: Re: fseeko bug
Date: Thu, 13 Dec 2007 19:10:08 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> 
> Larry Jones <lawrence.jones <at> siemens.com> writes:
> 
> > 
> > CVS nightly testing has been failing on BSD/OS and I've finally tracked
> > the problem down to a bug in fseeko -- it doesn't clear the EOF flag
> > after doing its magic:
> 
> Just to make sure other platforms aren't affected, I'm installing this.

Sure enough, mingw is affected.  I'm installing this.


From: Eric Blake <address@hidden>
Date: Thu, 13 Dec 2007 12:09:31 -0700
Subject: [PATCH] Fix fseeko on mingw.

* lib/fseeko.c (rpl_fseeko) [_IOERR]: Reset EOF flag on successful
seek.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    |    4 ++++
 lib/fseeko.c |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b91f640..dd3d5f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-12-13  Eric Blake  <address@hidden>
 
+       Fix fseeko on mingw.
+       * lib/fseeko.c (rpl_fseeko) [_IOERR]: Reset EOF flag on successful
+       seek.
+
        Beef up fseek tests.
        * tests/test-fseek.c (main): Also test eof handling.
        * tests/test-fseeko.c (main): Likewise.
diff --git a/lib/fseeko.c b/lib/fseeko.c
index e495226..97dcf6d 100644
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -112,6 +112,8 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
          fp->_offset = pos;
          fp->_flags |= __SOFF;
          fp->_flags &= ~__SEOF;
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw 
*/
+          fp->_flag &= ~_IOEOF;
 #endif
          return 0;
        }
-- 
1.5.3.5







reply via email to

[Prev in Thread] Current Thread [Next in Thread]