diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-10-20 13:29:45 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-10-20 13:29:45 +0000 |
commit | 70ab029ab9946561631c5f558812b36eb0e0a675 (patch) | |
tree | 88a4e01d89958384c449baca458ba4181cf66c91 /usr.sbin | |
parent | 59343009af568a43bdd36606a866dfca734e0a56 (diff) |
forgot about ospfd in last commit.
ok hennin@ too.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospfd/ospfd.c | 9 | ||||
-rw-r--r-- | usr.sbin/ospfd/parse.y | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c index e9dcca5b27a..5ccd10f12e4 100644 --- a/usr.sbin/ospfd/ospfd.c +++ b/usr.sbin/ospfd/ospfd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfd.c,v 1.54 2007/10/14 19:35:01 claudio Exp $ */ +/* $OpenBSD: ospfd.c,v 1.55 2007/10/20 13:29:44 pyr Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -136,6 +136,8 @@ main(int argc, char *argv[]) conffile = CONF_FILE; ospfd_process = PROC_MAIN; + log_init(1); /* log to stderr until daemonized */ + while ((ch = getopt(argc, argv, "cdf:nv")) != -1) { switch (ch) { case 'c': @@ -162,9 +164,6 @@ main(int argc, char *argv[]) } } - /* start logging */ - log_init(debug); - mib[0] = CTL_NET; mib[1] = PF_INET; mib[2] = IPPROTO_IP; @@ -203,6 +202,8 @@ main(int argc, char *argv[]) if (getpwnam(OSPFD_USER) == NULL) errx(1, "unknown user %s", OSPFD_USER); + log_init(debug); + if (!debug) daemon(1, 0); diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y index 0bbf5f5bedd..c5a8b82b7e4 100644 --- a/usr.sbin/ospfd/parse.y +++ b/usr.sbin/ospfd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.57 2007/10/16 20:01:23 mpf Exp $ */ +/* $OpenBSD: parse.y,v 1.58 2007/10/20 13:29:44 pyr Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -958,9 +958,12 @@ pushfile(const char *name, int secret) struct file *nfile; if ((nfile = calloc(1, sizeof(struct file))) == NULL || - (nfile->name = strdup(name)) == NULL) + (nfile->name = strdup(name)) == NULL) { + log_warn("malloc"); return (NULL); + } if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { + log_warn("%s", nfile->name); free(nfile->name); free(nfile); return (NULL); @@ -1019,7 +1022,6 @@ parse_config(char *filename, int opts) conf->spf_state = SPF_IDLE; if ((file = pushfile(filename, !(conf->opts & OSPFD_OPT_NOACTION))) == NULL) { - warn("%s", filename); free(conf); return (NULL); } |