diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-04-11 20:08:30 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-04-11 20:08:30 +0000 |
commit | 8e14d7ffbb0f95f3cd28df437ea49291074fe0a9 (patch) | |
tree | 679097a8e659b2a2f13c46008c0d6b4ffed547b7 /src | |
parent | e972b27d0566c5c3f093763c12841718b7a5bd57 (diff) | |
download | coreutils-8e14d7ffbb0f95f3cd28df437ea49291074fe0a9.tar.xz |
Include unistd-safer.h.
(main): Don't dup stderr to stdin or stdout by mistake.
Diffstat (limited to 'src')
-rw-r--r-- | src/nohup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nohup.c b/src/nohup.c index 9dd7c2e7c..f1c6eca9c 100644 --- a/src/nohup.c +++ b/src/nohup.c @@ -25,11 +25,12 @@ #include "system.h" +#include "cloexec.h" #include "error.h" #include "long-options.h" #include "path-concat.h" #include "quote.h" -#include "cloexec.h" +#include "unistd-safer.h" #define PROGRAM_NAME "nohup" @@ -145,7 +146,7 @@ main (int argc, char **argv) if execve fails. It's no big deal if this dup fails. It might not change anything, and at worst, it'll lead to suppression of the post-failed-execve diagnostic. */ - saved_stderr_fd = dup (STDERR_FILENO); + saved_stderr_fd = dup_safer (STDERR_FILENO); if (0 <= saved_stderr_fd && set_cloexec_flag (saved_stderr_fd, true) != 0) |