Mercurial > hg > octave-nkf > gnulib-hg
changeset 6627:9e28dc7b0d44
* 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.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 08 Feb 2006 00:04:23 +0000 |
parents | ec47b17f9d1d |
children | 49c3465f6888 |
files | lib/ChangeLog lib/closeout.c |
diffstat | 2 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2006-02-07 Paul Eggert <eggert@cs.ucla.edu> + + * 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. + 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua> * argp-namefrob.h: Restore changes accidentally lost during the
--- a/lib/closeout.c +++ b/lib/closeout.c @@ -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 @@ 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) {