changeset 3690:5cfc971da5b7

(close_stdout_status): If ferror (stdout), do not silently exit merely because the output buffer happens to have nothing pending.
author Jim Meyering <jim@meyering.net>
date Thu, 20 Dec 2001 10:01:25 +0000
parents 27e5e0915016
children 258f34c3ab08
files lib/closeout.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/closeout.c
+++ b/lib/closeout.c
@@ -94,7 +94,9 @@
 {
   int e = ferror (stdout) ? 0 : -1;
 
-  if (__fpending (stdout) == 0)
+  /* If the stream's error bit is clear and there is nothing to flush,
+     then return right away.  */
+  if (e && __fpending (stdout) == 0)
     return;
 
   if (fclose (stdout) != 0)