mktemp: don't try to close stdout twice
authorJim Meyering <meyering@redhat.com>
Thu, 5 Nov 2009 15:26:19 +0000 (16:26 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 5 Nov 2009 15:32:52 +0000 (16:32 +0100)
commit22e4276ed1b3ef67446e8f003b7bcf7753cbc9bc
treed291bdd8c0c4aa720c07a500ed623f3bd31fe10b
parent25d2460ae3dcbfb557016bbac6e8568e258caed3
mktemp: don't try to close stdout twice

* 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.
src/mktemp.c