aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/dhcp.c
diff options
context:
space:
mode:
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);