diff options
author | 2004-04-12 22:24:32 +0000 | |
---|---|---|
committer | 2004-04-12 22:24:32 +0000 | |
commit | 30d522dd295bac8cd308a82754eed0a600b45744 (patch) | |
tree | 2089cb3a42cf342dfcc6ef0d96c4a5a83371f55e | |
parent | spacing (diff) | |
download | wireguard-openbsd-30d522dd295bac8cd308a82754eed0a600b45744.tar.xz wireguard-openbsd-30d522dd295bac8cd308a82754eed0a600b45744.zip |
se daemon(3)
-rw-r--r-- | usr.sbin/dhcrelay/dhcrelay.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/usr.sbin/dhcrelay/dhcrelay.c b/usr.sbin/dhcrelay/dhcrelay.c index 620899c607e..fa9b3bff4ee 100644 --- a/usr.sbin/dhcrelay/dhcrelay.c +++ b/usr.sbin/dhcrelay/dhcrelay.c @@ -173,21 +173,8 @@ int main (argc, argv) bootp_packet_handler = relay; /* Become a daemon... */ - if (!no_daemon) { - int pid; - - log_perror = 0; - - if ((pid = fork()) < 0) - error ("can't fork daemon: %m"); - else if (pid) - exit (0); - - close (0); - close (1); - close (2); - pid = setsid (); - } + if (!no_daemon) + daemon(0, 0); /* Start dispatching packets and timeouts... */ dispatch (); |