summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mktemp.c4
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;