]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Test mode removes the daemonise bit, so check for both when setting the timeout.
authorRoy Marples <roy@marples.name>
Tue, 3 Feb 2015 09:00:36 +0000 (09:00 +0000)
committerRoy Marples <roy@marples.name>
Tue, 3 Feb 2015 09:00:36 +0000 (09:00 +0000)
dhcpcd.c

index be3a5e6ca22493d1f02ee568f5c2fef4cd7b2a89..563fe479b3d5436f19f4297b40be152a16fc40a3 100644 (file)
--- 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);
                }