mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-25 02:45:15 +08:00
(close_stdout_status): If ferror (stdout), do
not silently exit merely because the output buffer happens to have nothing pending.
This commit is contained in:
parent
82a83f3743
commit
8d83abaf89
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user