aboutsummaryrefslogtreecommitdiff
path: root/coreutils/nohup.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/nohup.c')
-rw-r--r--coreutils/nohup.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/coreutils/nohup.c b/coreutils/nohup.c
index 41c4b779c..86d788683 100644
--- a/coreutils/nohup.c
+++ b/coreutils/nohup.c
@@ -9,9 +9,6 @@
9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
10 */ 10 */
11 11
12#include <fcntl.h>
13#include <signal.h>
14#include <unistd.h>
15#include "busybox.h" 12#include "busybox.h"
16 13
17int nohup_main(int argc, char *argv[]) 14int nohup_main(int argc, char *argv[])
@@ -25,7 +22,7 @@ int nohup_main(int argc, char *argv[])
25 22
26 if (argc<2) bb_show_usage(); 23 if (argc<2) bb_show_usage();
27 24
28 nullfd = bb_xopen(bb_dev_null, O_WRONLY|O_APPEND); 25 nullfd = xopen(bb_dev_null, O_WRONLY|O_APPEND);
29 // If stdin is a tty, detach from it. 26 // If stdin is a tty, detach from it.
30 27
31 if (isatty(0)) dup2(nullfd, 0); 28 if (isatty(0)) dup2(nullfd, 0);
@@ -38,7 +35,7 @@ int nohup_main(int argc, char *argv[])
38 home = getenv("HOME"); 35 home = getenv("HOME");
39 if (home) { 36 if (home) {
40 home = concat_path_file(home, nohupout); 37 home = concat_path_file(home, nohupout);
41 bb_xopen3(nohupout, O_CREAT|O_WRONLY|O_APPEND, S_IRUSR|S_IWUSR); 38 xopen3(nohupout, O_CREAT|O_WRONLY|O_APPEND, S_IRUSR|S_IWUSR);
42 } 39 }
43 } 40 }
44 } else dup2(nullfd, 1); 41 } else dup2(nullfd, 1);