aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/dhcp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-05-31 12:33:24 -0500
committerRob Landley <rob@landley.net>2014-05-31 12:33:24 -0500
commitd8872c43b48eae5501998a4e5a84337017d8fbe6 (patch)
tree8360d8673d0ed40b02f9d58bdf74b639f6e780f9 /toys/pending/dhcp.c
parentb0d97a0059555cb0e7e0009b72c038aa67aaa769 (diff)
downloadtoybox-d8872c43b48eae5501998a4e5a84337017d8fbe6.tar.gz
Introduce xfork() and make commands use it, and make some WEXITSTATUS() use WIFEXITED() and WTERMSIG()+127.
Diffstat (limited to 'toys/pending/dhcp.c')
-rw-r--r--toys/pending/dhcp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/toys/pending/dhcp.c b/toys/pending/dhcp.c
index 2b432cb3..636746da 100644
--- a/toys/pending/dhcp.c
+++ b/toys/pending/dhcp.c
@@ -318,10 +318,8 @@ static int dhcp_daemon(void)
{
int fd = open("/dev/null", O_RDWR);
if (fd < 0) fd = xcreate("/", O_RDONLY, 0666);
- pid_t pid = fork();
- if (pid < 0) perror_exit("DAEMON: failed to fork");
- if (pid) exit(EXIT_SUCCESS);
+ if (xfork()) exit(0);
setsid();
dup2(fd, 0);