mktemp: fix bug with -q and closed stdout
authorEric Blake <ebb9@byu.net>
Thu, 5 Nov 2009 19:19:45 +0000 (12:19 -0700)
committerEric Blake <ebb9@byu.net>
Sat, 7 Nov 2009 17:10:25 +0000 (10:10 -0700)
commitc768e2231b89901a2e29c3bf96c027b64f8646d9
treeef0381745bb5f50fd882100375921cccfd3ddd87
parent9a8d8f46a541d333f98dca26d053d1f5bd4424bb
mktemp: fix bug with -q and closed stdout

If stdin or stdout is closed, then freopen(,stderr) can violate
the premise that STDERR_FILENO==fileno(stderr), which in turn
breaks mktemp -q.

* bootstrap.conf (gnulib_modules): Add freopen-safer.
* src/mktemp.c (includes): Use stdio--.h.
* tests/misc/close-stdout: Enhance test to catch bug.
bootstrap.conf
src/mktemp.c
tests/misc/close-stdout