]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Redirect to /dev/null unless test or quiet and not debug
authorRoy Marples <roy@marples.name>
Wed, 15 Apr 2020 15:50:32 +0000 (16:50 +0100)
committerRoy Marples <roy@marples.name>
Wed, 15 Apr 2020 15:50:32 +0000 (16:50 +0100)
Keeps the rtsol like behaviour the same.

src/privsep.c

index 5f8af83d453c6b65c2e15a17cf9f1b044c287eec..2b68af2f75ab327baec99c5d40438a7b29a90033 100644 (file)
@@ -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);
        }