From: Roy Marples Date: Tue, 15 Jul 2008 15:06:09 +0000 (+0000) Subject: Don't log about trying to use a non existant lease. X-Git-Tag: v4.0.2~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d67c3bbb4c4b2f7b34751cb53afc0a6595c2c484;p=thirdparty%2Fdhcpcd.git Don't log about trying to use a non existant lease. --- diff --git a/client.c b/client.c index 7b76662f..42b4ecfb 100644 --- a/client.c +++ b/client.c @@ -402,21 +402,21 @@ get_old_lease(struct if_state *state) { struct interface *iface = state->interface; struct dhcp_lease *lease = &state->lease; - struct dhcp_message *dhcp; + struct dhcp_message *dhcp = NULL; struct timeval tv; unsigned int offset = 0; struct stat sb; + if (stat(iface->leasefile, &sb) == -1) { + if (errno != ENOENT) + logger(LOG_ERR, "stat: %s", strerror(errno)); + goto eexit; + } if (!IN_LINKLOCAL(ntohl(iface->addr.s_addr))) logger(LOG_INFO, "trying to use old lease in `%s'", iface->leasefile); if ((dhcp = read_lease(iface)) == NULL) { - if (errno != ENOENT) - logger(LOG_INFO, "read_lease: %s", strerror(errno)); - goto eexit; - } - if (stat(iface->leasefile, &sb) == -1) { - logger(LOG_ERR, "stat: %s", strerror(errno)); + logger(LOG_INFO, "read_lease: %s", strerror(errno)); goto eexit; } get_lease(&state->lease, dhcp);