summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mktemp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mktemp.c b/src/mktemp.c
index f60e82486..980ec3930 100644
--- a/src/mktemp.c
+++ b/src/mktemp.c
@@ -325,7 +325,7 @@ main (int argc, char **argv)
puts (dest_name);
/* If we created a file, but then failed to output the file
name, we should clean up the mess before failing. */
- if (!dry_run && close_stream (stdout))
+ if (!dry_run && (ferror (stdout) || fflush (stdout) != 0))
{
int saved_errno = errno;
remove (dest_name);