From 2c3d0355d644cee32f9bbf0fcbc72ca550172d48 Mon Sep 17 00:00:00 2001 From: reyk Date: Wed, 5 Jul 2017 11:11:56 +0000 Subject: [PATCH] Don't stop logging to stderr when running in foreground with -d. Pointed out by Kapetanakis Giannis --- usr.sbin/dhcrelay/dhcrelay.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.sbin/dhcrelay/dhcrelay.c b/usr.sbin/dhcrelay/dhcrelay.c index 161d289ad1d..7ae9b1e80be 100644 --- a/usr.sbin/dhcrelay/dhcrelay.c +++ b/usr.sbin/dhcrelay/dhcrelay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcrelay.c,v 1.62 2017/04/04 15:50:29 reyk Exp $ */ +/* $OpenBSD: dhcrelay.c,v 1.63 2017/07/05 11:11:56 reyk Exp $ */ /* * Copyright (c) 2004 Henning Brauer @@ -106,7 +106,6 @@ main(int argc, char *argv[]) daemonize = 1; log_init(1, LOG_DAEMON); /* log to stderr until daemonized */ - log_setverbose(1); setup_iflist(); @@ -309,9 +308,9 @@ main(int argc, char *argv[]) if (daemonize) { if (rdaemon(devnull) == -1) fatal("rdaemon"); + + log_init(0, LOG_DAEMON); /* stop logging to stderr */ } - log_init(0, LOG_DAEMON); /* stop loggoing to stderr */ - log_setverbose(0); if (pledge("stdio route", NULL) == -1) fatalx("pledge"); -- 2.20.1