diff options
author | Jim Meyering <meyering@redhat.com> | 2008-10-12 16:09:00 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-10-16 23:00:22 +0200 |
commit | 16c806208576ebc5713d74e828198caba0c5fd5a (patch) | |
tree | b499ee183579db7f3b9e9761677682fb5f937335 | |
parent | 17278118eef6ee156c810bc3b624716034dcdf87 (diff) | |
download | coreutils-16c806208576ebc5713d74e828198caba0c5fd5a.tar.xz |
mktemp: diagnose freopen failure
* src/mktemp [--quiet]: Don't ignore freopen failure.
-rw-r--r-- | src/mktemp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mktemp.c b/src/mktemp.c index ffb21d466..2e6dc7b85 100644 --- a/src/mktemp.c +++ b/src/mktemp.c @@ -188,7 +188,9 @@ main (int argc, char **argv) { /* From here on, redirect stderr to /dev/null. A diagnostic from getopt_long, above, would still go to stderr. */ - freopen ("/dev/null", "wb", stderr); + if (!freopen ("/dev/null", "wb", stderr)) + error (EXIT_FAILURE, errno, + _("failed to redirect stderr to /dev/null")); } n_args = argc - optind; |