From: Larry Jones <lawrence.jones@siemens.com>
Date: Thu, 13 Dec 2007 18:11:53 +0000 (-0700)
Subject: Fix fseeko on BSD-based platforms.
X-Git-Tag: v0.1~7926
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=87c273e10b3ec2a2a1e1cecd0662348d8f3c52c9;p=gnulib.git

Fix fseeko on BSD-based platforms.

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

diff --git a/ChangeLog b/ChangeLog
index 1b1f43b524..f430f7bc59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-13  Larry Jones  <lawrence.jones@siemens.com>  (tiny change)
+
+	Fix fseeko on BSD-based platforms.
+	* lib/fseeko.c (rpl_fseeko) [__sferror]: Reset EOF flag on
+	successful seek.
+
 2007-12-12  Eric Blake  <ebb9@byu.net>
 
 	Allow circular dependency of separate libtests.a
diff --git a/lib/fseeko.c b/lib/fseeko.c
index 48c833b840..e495226a4f 100644
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -111,6 +111,7 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
 #if defined __sferror               /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
 	  fp->_offset = pos;
 	  fp->_flags |= __SOFF;
+	  fp->_flags &= ~__SEOF;
 #endif
 	  return 0;
 	}