Fix fpurge for cygwin.
authorEric Blake <ebb9@byu.net>
Mon, 16 Apr 2007 15:02:36 +0000 (15:02 +0000)
committerEric Blake <ebb9@byu.net>
Mon, 16 Apr 2007 15:02:36 +0000 (15:02 +0000)
* lib/fpurge.c (fpurge): Fix order of operation flub, and return a
value.
* modules/fpurge-tests (Depends-on): Clean up trash.

ChangeLog
lib/fpurge.c
modules/fpurge-tests

index 046b391..e5fdd00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-16  Eric Blake  <ebb9@byu.net>
+
+       Fix fpurge for cygwin.
+       * lib/fpurge.c (fpurge): Fix order of operation flub, and return a
+       value.
+       * modules/fpurge-tests (Depends-on): Clean up trash.
+
 2007-04-16  Simon Josefsson  <simon@josefsson.org>
 
        * lib/gc-libgcrypt.c (gc_hash_open): Shut up compiler warnings.
        * m4/locale_h.m4: New file.
 
 2007-04-10  Paul Eggert  <eggert@cs.ucla.edu>
-            Bruno Haible  <bruno@clisp.org>
+           Bruno Haible  <bruno@clisp.org>
 
        * m4/signbit.m4 (gl_SIGNBIT): When the sign bit position could not
        be determined, test for availability of the copysignf, copysign,
index dc56c8f..c4572fa 100644 (file)
@@ -33,9 +33,10 @@ fpurge (FILE *fp)
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
   fp->_p = fp->_bf._base;
   fp->_r = 0;
-  fp->_w = ((fp->_flags & (__SLBF | __SNBF) == 0) /* fully buffered? */
+  fp->_w = ((fp->_flags & (__SLBF | __SNBF)) == 0 /* fully buffered? */
            ? fp->_bf._size
            : 0);
+  return 0;
 #elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
   fp->_ptr = fp->_base;
   if (fp->_ptr != NULL)
index c80a5eb..fc4da8a 100644 (file)
@@ -8,4 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-fpurge
 check_PROGRAMS += test-fpurge
-
+MOSTLYCLEANFILES += t-fpurge.tmp