summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-02-03 09:00:36 +0000
committerRoy Marples <roy@marples.name>2015-02-03 09:00:36 +0000
commit28fba2bb64d538f039e0e1f1dacc212b69ca23e5 (patch)
treed7120fe2d72be27202a034e609d507f5d822d285 /dhcpcd.c
parent6dff2cb37141ab252ab343ab50083630b384c2e6 (diff)
downloaddhcpcd-28fba2bb64d538f039e0e1f1dacc212b69ca23e5.tar.xz
Test mode removes the daemonise bit, so check for both when setting the timeout.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c5
1 files changed, 4 insertions, 1 deletions
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);
}