summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-07-22 17:00:06 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-07-22 17:00:06 +0000
commit0e48d9308ec10d44f37885f0c74cc805cefee52d (patch)
tree059e242eb98be30fa5dceb39f6ca80a9230e1021
parent963815b85bef064f335066155e41c887596a6e01 (diff)
daemonize if using syslog(3)
-rw-r--r--usr.sbin/ipmon/ipmon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ipmon/ipmon.c b/usr.sbin/ipmon/ipmon.c
index 595c0406e40..e882089b9b8 100644
--- a/usr.sbin/ipmon/ipmon.c
+++ b/usr.sbin/ipmon/ipmon.c
@@ -41,7 +41,7 @@
#include <ctype.h>
#if !defined(lint) && defined(LIBC_SCCS)
-static char rcsid[] = "$Id: ipmon.c,v 1.9 1997/06/23 16:53:59 kstailey Exp $";
+static char rcsid[] = "$Id: ipmon.c,v 1.10 1997/07/22 17:00:05 kstailey Exp $";
#endif
#include "ip_fil_compat.h"
@@ -548,6 +548,8 @@ char *argv[];
if (!(opts & OPT_SYSLOG)) {
log = argv[optind] ? fopen(argv[optind], "a") : stdout;
setvbuf(log, NULL, _IONBF, 0);
+ } else {
+ daemon(0, 0);
}
if (flushed) {