bug-gnulib
[Top][All Lists]
Advanced

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

closeout portability fix for pre-C99 stdbool.h


From: Paul Eggert
Subject: closeout portability fix for pre-C99 stdbool.h
Date: Tue, 07 Feb 2006 16:06:09 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I installed this into gnulib (and soon into coreutils):

2006-02-07  Paul Eggert  <address@hidden>

        * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
        ints to 0 or 1, as this isn't true for the stdbool.h substitute.

--- closeout.c  19 Sep 2005 17:28:14 -0000      1.18
+++ closeout.c  8 Feb 2006 00:04:23 -0000       1.19
@@ -1,7 +1,7 @@
 /* closeout.c - close standard output
 
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software
-   Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006 Free
+   Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -73,9 +73,9 @@ close_stdout_set_file_name (const char *
 void
 close_stdout (void)
 {
-  bool prev_fail = ferror (stdout);
-  bool none_pending = (0 == __fpending (stdout));
-  bool fclose_fail = fclose (stdout);
+  bool none_pending = (__fpending (stdout) == 0);
+  bool prev_fail = (ferror (stdout) != 0);
+  bool fclose_fail = (fclose (stdout) != 0);
 
   if (prev_fail || fclose_fail)
     {




reply via email to

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