]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Exit correctly on error.
authorRoy Marples <roy@marples.name>
Tue, 24 Aug 2010 10:25:32 +0000 (10:25 +0000)
committerRoy Marples <roy@marples.name>
Tue, 24 Aug 2010 10:25:32 +0000 (10:25 +0000)
dhcpcd.c

index 4a20f0d1f0a0982b7337878fdaffb1617a7146b8..07e68ed421422c0a903de78574cd5b7723d8012e 100644 (file)
--- 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";