NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/55170 dhcpcd fails when used instead of rtsol



The following reply was made to PR bin/55170; it has been noted by GNATS.

From: Roy Marples <roy%marples.name@localhost>
To: gnats-bugs%NetBSD.org@localhost, Kimmo Suominen <kim%netbsd.org@localhost>
Cc: 
Subject: Re: bin/55170 dhcpcd fails when used instead of rtsol
Date: Tue, 14 Apr 2020 12:06:06 +0100

 On 13/04/2020 18:07, Roy Marples wrote:
 > I'll fix the -q option not silencing the TEST output though.
 
 This patch should fix both the quiestness and the error.
 There is no need to create the control socket in test mode.
 
 diff --git a/src/dhcpcd.c b/src/dhcpcd.c
 index eb8d5608..7bf52f4f 100644
 --- a/src/dhcpcd.c
 +++ b/src/dhcpcd.c
 @@ -2207,7 +2207,8 @@ printpidfile:
                  goto run_loop;
   #endif
 
 -       if (control_start(&ctx,
 +       if (!(ctx.options & DHCPCD_TEST) &&
 +           control_start(&ctx,
              ctx.options & DHCPCD_MASTER ? NULL : argv[optind]) == -1)
          {
                  logerr("%s: control_start", __func__);
 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);
          }
 


Home | Main Index | Thread Index | Old Index