aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1995-07-18 21:35:32 +0000
committerBill Paul <wpaul@FreeBSD.org>1995-07-18 21:35:32 +0000
commitcef6b9bc3e9ee584239ce1d9b4b4ce6bf98dacb2 (patch)
treed326d7c47dffb170b8e1f375255a8d6aed0e7833 /usr.sbin
parent7f101baa9dc7ebe8b47a7462850e3e78c5b9dac9 (diff)
downloadsrc-cef6b9bc3e9ee584239ce1d9b4b4ce6bf98dacb2.tar.gz
src-cef6b9bc3e9ee584239ce1d9b4b4ce6bf98dacb2.zip
Use daemon() to deamonify ourselves.
Notes
Notes: svn path=/head/; revision=9577
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rarpd/rarpd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index a884f1cde22a..ea649dbe839f 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();
}