diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-07-18 21:35:32 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-07-18 21:35:32 +0000 |
commit | 5cc8f19489da10f873027a3f8c7ebda449cd10e4 (patch) | |
tree | d326d7c47dffb170b8e1f375255a8d6aed0e7833 /usr.sbin/rarpd | |
parent | e3cfc5d38ea775aed49792f2ec029d69567ac760 (diff) | |
download | FreeBSD-src-5cc8f19489da10f873027a3f8c7ebda449cd10e4.zip FreeBSD-src-5cc8f19489da10f873027a3f8c7ebda449cd10e4.tar.gz |
Use daemon() to deamonify ourselves.
Diffstat (limited to 'usr.sbin/rarpd')
-rw-r--r-- | usr.sbin/rarpd/rarpd.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c index a884f1c..ea649db 100644 --- a/usr.sbin/rarpd/rarpd.c +++ b/usr.sbin/rarpd/rarpd.c @@ -26,7 +26,7 @@ char copyright[] = #ifndef lint static char rcsid[] = - "@(#) $Header: /home/ncvs/src/usr.sbin/rarpd/rarpd.c,v 1.3 1995/04/02 01:35:54 wpaul Exp $ (LBL)"; + "@(#) $Header: /home/ncvs/src/usr.sbin/rarpd/rarpd.c,v 1.4 1995/05/30 03:51:25 rgrimes Exp $ (LBL)"; #endif @@ -166,16 +166,11 @@ main(argc, argv) else init_one(ifname); - if (!fflag) { - pid = fork(); - if (pid > 0) - /* Parent exits, leaving child in background. */ + if (!fflag) + if (daemon(0,0)) { + perror("fork"); exit(0); - else if (pid == -1) { - syslog(LOG_ERR, "cannot fork"); - exit(1); } - } rarp_loop(); } |