fclose: Fix mistake earlier today.
authorBruno Haible <bruno@clisp.org>
Thu, 12 May 2011 00:01:00 +0000 (02:01 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 12 May 2011 00:01:00 +0000 (02:01 +0200)
* lib/fclose.c (rpl_fclose): Don't assume that EOF < 0.

ChangeLog
lib/fclose.c

index e8e37db..4589122 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-11  Bruno Haible  <bruno@clisp.org>
+
+       fclose: Fix mistake earlier today.
+       * lib/fclose.c (rpl_fclose): Don't assume that EOF < 0.
+
 2011-05-11  Eric Blake  <eblake@redhat.com>
 
        fclose: preserve fflush errors
index c0dfa27..27f6836 100644 (file)
@@ -65,7 +65,7 @@ rpl_fclose (FILE *fp)
      Some other thread could open fd between our calls to fclose and
      _gl_unregister_fd.  */
   result = fclose (fp);
-  if (result >= 0)
+  if (result == 0)
     _gl_unregister_fd (fd);
 # else
   /* No race condition here.  */