* src/mktemp.c (main): Rather than calling close_stream (which would
make atexit-called close_stdout try to close it a second time),
check for write failure via ferror and fflush.
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);