/* 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
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
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)
{