From: Roy Marples Date: Fri, 1 Aug 2008 10:22:44 +0000 (+0000) Subject: Don't bother waiting on a negative timeout and fix poll -> select error message. X-Git-Tag: v4.0.2~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e8e514928d59cb195e6616f1b0eda92baae63ae;p=thirdparty%2Fdhcpcd.git Don't bother waiting on a negative timeout and fix poll -> select error message. --- diff --git a/client.c b/client.c index 346da0ce..f2a71ff3 100644 --- a/client.c +++ b/client.c @@ -807,6 +807,8 @@ wait_for_fd(struct if_state *state, int *fd) } ref = get_lowest_timer(state); + if (ref && timerneg(ref)) + return 0; if (state->lease.leasetime == ~0U && state->state == STATE_BOUND) @@ -857,7 +859,7 @@ wait_for_fd(struct if_state *state, int *fd) if (r == -1) { if (errno != EINTR) - logger(LOG_ERR, "poll: %s", strerror(errno)); + logger(LOG_ERR, "select: %s", strerror(errno)); return -1; } if (r != 0) {