summaryrefslogtreecommitdiffstats
path: root/src/privsep.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-15 16:50:32 +0100
committerRoy Marples <roy@marples.name>2020-04-15 16:50:32 +0100
commit2ca05850279d0611d1761f4d2a9b717bc283345c (patch)
tree04acd9e81d434962503acac9be6bd90190712a63 /src/privsep.c
parent3110315782738f0da4ce0b3bde1e43fc77ee0591 (diff)
downloaddhcpcd-2ca05850279d0611d1761f4d2a9b717bc283345c.tar.xz
privsep: Redirect to /dev/null unless test or quiet and not debug
Keeps the rtsol like behaviour the same.
Diffstat (limited to 'src/privsep.c')
-rw-r--r--src/privsep.c4
1 files changed, 3 insertions, 1 deletions
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);
}