X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fcloseout.c;h=0c78b6e4c3e0fd9b9a4a0a976542bc5c8f838fbe;hb=b5a2c641784fe37cba7c02f109edda0fbed47de3;hp=aee1fcbbafb5c7ce0a24c94c981633b046d7146a;hpb=92f1833affa37844e22d2ebe4ca4c6ba924377f4;p=gnulib.git diff --git a/lib/closeout.c b/lib/closeout.c index aee1fcbba..0c78b6e4c 100644 --- a/lib/closeout.c +++ b/lib/closeout.c @@ -94,7 +94,9 @@ close_stdout_status (int status) { 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)