From: Roy Marples Date: Tue, 3 Feb 2015 09:00:36 +0000 (+0000) Subject: Test mode removes the daemonise bit, so check for both when setting the timeout. X-Git-Tag: v6.8.0~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28fba2bb64d538f039e0e1f1dacc212b69ca23e5;p=thirdparty%2Fdhcpcd.git Test mode removes the daemonise bit, so check for both when setting the timeout. --- diff --git a/dhcpcd.c b/dhcpcd.c index be3a5e6c..563fe479 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1760,7 +1760,10 @@ main(int argc, char **argv) syslog(LOG_WARNING, "no interfaces have a carrier"); if (dhcpcd_daemonise(&ctx)) goto exit_success; - } else if (t > 0 && ctx.options & DHCPCD_DAEMONISE) { + } else if (t > 0 && + /* Test mode removes the daeomise bit, so check for both */ + ctx.options & (DHCPCD_DAEMONISE | DHCPCD_TEST)) + { eloop_timeout_add_sec(ctx.eloop, t, handle_exit_timeout, &ctx); }