diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-12 22:24:33 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-12 22:24:33 +0000 |
commit | 36c76afafcc023e38f06cab76b49c41155ff4ec7 (patch) | |
tree | 27fabd70d06cd25a1d7e61e41cad44b1a91a7f81 /usr.sbin/dhcrelay/dhcrelay.c | |
parent | 9b37e71456a95d39cd56f011bfcccca72be9e661 (diff) |
se daemon(3)
Diffstat (limited to 'usr.sbin/dhcrelay/dhcrelay.c')
-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 (); |