diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-02-26 11:53:00 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-02-26 11:53:00 +0000 |
commit | 79c6c491cea62c4fc7a2fbce1038424de50f5ec0 (patch) | |
tree | bb5da8924e5e02ccc88c78dee5793f26a8ff1a73 /usr.sbin/ifstated | |
parent | 38de66c2d0a8699e7cf562c079b8e2eeb48fe826 (diff) |
bring in log_init() from bgpd which gives us openlog(), ryan ok
Diffstat (limited to 'usr.sbin/ifstated')
-rw-r--r-- | usr.sbin/ifstated/ifstated.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c index 999a7f7a136..7782185e642 100644 --- a/usr.sbin/ifstated/ifstated.c +++ b/usr.sbin/ifstated/ifstated.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifstated.c,v 1.11 2004/02/16 05:26:58 mcbride Exp $ */ +/* $OpenBSD: ifstated.c,v 1.12 2004/02/26 11:52:59 henning Exp $ */ /* * Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org> @@ -74,6 +74,7 @@ void state_change(void); void do_action(struct ifsd_action *); void remove_action(struct ifsd_action *, struct ifsd_state *); void remove_expression(struct ifsd_expression *, struct ifsd_state *); +void log_init(int); void logit(int level, const char *fmt, ...); void @@ -130,6 +131,8 @@ main(int argc, char *argv[]) exit(0); } + log_init(opt_debug); + if (!opt_debug) { daemon(0, 0); setproctitle(NULL); @@ -669,6 +672,15 @@ remove_expression(struct ifsd_expression *expression, } void +log_init(int n_debug) +{ + extern char *__progname; + + if (!n_debug) + openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON); +} + +void logit(int level, const char *fmt, ...) { va_list ap; |