1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 02:36:16 +02:00

(xfclose): Don't close stdout here (just flush it),

since close_stdout now closes stdout unconditionally.
This commit is contained in:
Jim Meyering
2004-11-06 22:37:02 +00:00
parent 3e0f7c5dc3
commit d73a00981c

View File

@@ -480,6 +480,12 @@ xfclose (FILE *fp, char const *file)
if (feof (fp))
clearerr (fp);
}
else if (fp == stdout)
{
/* Don't close stdout just yet. close_stdout does that. */
if (fflush (fp) != 0)
die (_("fflush failed"), file);
}
else
{
if (fclose (fp) != 0)