]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move the seconds waiting calc into the if where it's needed.
authorRoy Marples <roy@marples.name>
Sat, 26 Jul 2008 07:32:44 +0000 (07:32 +0000)
committerRoy Marples <roy@marples.name>
Sat, 26 Jul 2008 07:32:44 +0000 (07:32 +0000)
client.c

index 4e0ce35eaa4bafca322d29156ec966d62cc48496..7b3c2e66ed06982de67830503c3f2ef681618cda 100644 (file)
--- a/client.c
+++ b/client.c
@@ -799,13 +799,13 @@ wait_for_fd(struct if_state *state, int *fd)
 
        if (ref) {
                timersub(ref, &now, &tout);
-               secs = tout.tv_sec * 1.0 + tout.tv_usec * 1.0e-6;
                /* Only report waiting time if changed */
                if (last_stop_sec != state->stop.tv_sec ||
                    last_stop_usec != state->stop.tv_usec ||
                    last_timeout_sec != state->timeout.tv_sec ||
                    last_timeout_usec != state->timeout.tv_usec)
                {
+                       secs = tout.tv_sec * 1.0 + tout.tv_usec * 1.0e-6;
                        logger(LOG_DEBUG, "waiting for %0.2f seconds", secs);
                        last_stop_sec = state->stop.tv_sec;
                        last_stop_usec = state->stop.tv_usec;