]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix poll timeout.
authorRoy Marples <roy@marples.name>
Sun, 10 Feb 2008 23:40:24 +0000 (23:40 +0000)
committerRoy Marples <roy@marples.name>
Sun, 10 Feb 2008 23:40:24 +0000 (23:40 +0000)
client.c

index a05d63cf21c7fa480bbe58026484ccf5b8f1a6b6..e4d1019ea4b967a885202db17924b81a4037c690 100644 (file)
--- a/client.c
+++ b/client.c
@@ -522,13 +522,13 @@ static int wait_for_packet (struct pollfd *fds, state_t *state,
        retval = 0;
        while (state->timeout > 0 && retval == 0) {
                if (iface->fd == -1)
-                       timeout = INFTIM;
+                       timeout = (int) state->timeout;
                else {
                        timeout = TIMEOUT_MINI;
                        if (state->timeout < timeout)
                                timeout = (int) state->timeout;
-                       timeout *= 1000;
                }
+               timeout *= 1000;
                state->start = uptime ();
                retval = poll (fds, iface->fd == -1 ? 1 : 2, timeout);
                state->timeout -= uptime () - state->start;