]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Use timeout in test mode as well.
authorRoy Marples <roy@marples.name>
Fri, 30 Apr 2010 03:24:06 +0000 (03:24 +0000)
committerRoy Marples <roy@marples.name>
Fri, 30 Apr 2010 03:24:06 +0000 (03:24 +0000)
dhcpcd.c

index c3583de374a22dd33eb44f08dc8f0786aba3be93..adb65c4b61d6ff3f15879b0f8bce653f609e9050 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1878,12 +1878,15 @@ main(int argc, char **argv)
                {
                        syslog(LOG_WARNING, "no interfaces have a carrier");
                        daemonise();
-               } else if (options & DHCPCD_DAEMONISE && ifo->timeout > 0) {
+               } else if (ifo->timeout > 0 &&
+                          (options & DHCPCD_DAEMONISE ||
+                           options & DHCPCD_TEST))
+               {
                        if (options & DHCPCD_IPV4LL)
                                options |= DHCPCD_TIMEOUT_IPV4LL;
-                       add_timeout_sec(ifo->timeout, handle_exit_timeout, NULL);
+                       add_timeout_sec(ifo->timeout, handle_exit_timeout,
+                           NULL);
                }
-
        }
        free_options(ifo);