diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-12-07 12:52:01 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-12-07 12:52:01 +0000 |
commit | ed40a39552e150ff630ad0ff1c9d9d6efdb76cc4 (patch) | |
tree | b1bf4ccc4259aede50a77d89549cd218ddf0047b /usr.sbin | |
parent | 970d2fcc9bb0f23ed4b330ca072618cb9eddce1f (diff) |
tweak initial error logging
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/vmd/parse.y | 4 | ||||
-rw-r--r-- | usr.sbin/vmd/vmd.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/vmd/parse.y b/usr.sbin/vmd/parse.y index 38d3606017b..8df272eb4af 100644 --- a/usr.sbin/vmd/parse.y +++ b/usr.sbin/vmd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.3 2015/12/06 21:02:51 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.4 2015/12/07 12:52:00 reyk Exp $ */ /* * Copyright (c) 2007-2015 Reyk Floeter <reyk@openbsd.org> @@ -272,7 +272,7 @@ yyerror(const char *fmt, ...) if (vasprintf(&msg, fmt, ap) == -1) fatal("yyerror vasprintf"); va_end(ap); - warnx("%s:%d: %s", file->name, yylval.lineno, msg); + log_warnx("%s:%d: %s", file->name, yylval.lineno, msg); free(msg); return (0); } diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index 1b92b1b557e..ce901d447e3 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.21 2015/12/06 21:02:51 reyk Exp $ */ +/* $OpenBSD: vmd.c,v 1.22 2015/12/07 12:52:00 reyk Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -265,6 +265,9 @@ main(int argc, char **argv) int ch; const char *conffile = VMD_CONF; + /* log to stderr until daemonized */ + log_init(1, LOG_DAEMON); + if ((env = calloc(1, sizeof(*env))) == NULL) fatal("calloc: env"); @@ -295,9 +298,6 @@ main(int argc, char **argv) if (env->vmd_noaction && !env->vmd_debug) env->vmd_debug = 1; - /* log to stderr until daemonized */ - log_init(env->vmd_debug ? env->vmd_debug : 1, LOG_DAEMON); - /* check for root privileges */ if (geteuid()) fatalx("need root privileges"); |