From: Roy Marples Date: Tue, 24 Aug 2010 10:25:32 +0000 (+0000) Subject: Exit correctly on error. X-Git-Tag: v5.2.9~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e07d2a3e51e757f4ee56d52704fcde51ce66939;p=thirdparty%2Fdhcpcd.git Exit correctly on error. --- diff --git a/dhcpcd.c b/dhcpcd.c index 4a20f0d1..07e68ed4 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1780,8 +1780,10 @@ main(int argc, char **argv) strlcpy(iface->state->options->script, if_options->script, sizeof(iface->state->options->script)); iface->state->new = read_lease(iface); - if (iface->state->new == NULL && errno == ENOENT) { - syslog(LOG_ERR, "%s: no lease to dump", iface->name); + if (iface->state->new == NULL) { + if (errno == ENOENT) + syslog(LOG_ERR, "%s: no lease to dump", + iface->name); exit(EXIT_FAILURE); } iface->state->reason = "DUMP";