summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-11-06 22:37:02 +0000
committerJim Meyering <jim@meyering.net>2004-11-06 22:37:02 +0000
commitd73a00981c48bb84ec3ed678ab2cae52a13d34f8 (patch)
tree4b4d30b9564500818f9ca204b2be79656bacedcb /src
parent3e0f7c5dc39050b84ce17b4baf6b1b23b426d77f (diff)
downloadcoreutils-d73a00981c48bb84ec3ed678ab2cae52a13d34f8.tar.xz
(xfclose): Don't close stdout here (just flush it),
since close_stdout now closes stdout unconditionally.
Diffstat (limited to 'src')
-rw-r--r--src/sort.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sort.c b/src/sort.c
index 511d0994d..f607385b7 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -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)