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 e8e37db0e7724149209a277dd9bbb59818fca1c9..4589122157d86c34ed03c1fe20078de2e7f151d8 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 c0dfa27e9fe0443ab22ac66beace09301d6e06c3..27f6836584aeba124d94f61e6a63374ea2a9de4c 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.  */