From: Roy Marples Date: Wed, 15 Apr 2020 15:50:32 +0000 (+0100) Subject: privsep: Redirect to /dev/null unless test or quiet and not debug X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ca05850279d0611d1761f4d2a9b717bc283345c;p=thirdparty%2Fdhcpcd.git privsep: Redirect to /dev/null unless test or quiet and not debug Keeps the rtsol like behaviour the same. --- diff --git a/src/privsep.c b/src/privsep.c index 5f8af83d..2b68af2f 100644 --- a/src/privsep.c +++ b/src/privsep.c @@ -243,7 +243,9 @@ ps_dostart(struct dhcpcd_ctx *ctx, if (callback(recv_ctx) == -1) goto errexit; - if (!(ctx->options & (DHCPCD_TEST | DHCPCD_DEBUG))) { + if (!(ctx->options & DHCPCD_DEBUG) && + (!(ctx->options & DHCPCD_TEST) || loggetopts() & LOGERR_QUIET)) + { freopen(_PATH_DEVNULL, "w", stdout); freopen(_PATH_DEVNULL, "w", stderr); }