]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't open sockets if just sending a signal.
authorRoy Marples <roy@marples.name>
Sat, 8 Apr 2017 10:08:44 +0000 (11:08 +0100)
committerRoy Marples <roy@marples.name>
Sat, 8 Apr 2017 10:08:44 +0000 (11:08 +0100)
src/dhcpcd.c

index 432108e030f6b414062ca2a87db33d845d70ed9b..66dbb18a26a7a62ff84322b578c2bb65fa95f235 100644 (file)
@@ -1660,10 +1660,16 @@ printpidfile:
 
        /* Open our persistent sockets.
         * This is needed early for dumping leases on valid interfaces. */
-       if (if_opensockets(&ctx) == -1) {
-               syslog(LOG_ERR, "if_opensockets: %m");
-               goto exit_failure;
+#ifdef USE_SIGNALS
+       if (sig == 0) {
+#endif
+               if (if_opensockets(&ctx) == -1) {
+                       syslog(LOG_ERR, "if_opensockets: %m");
+                       goto exit_failure;
+               }
+#ifdef USE_SIGNALS
        }
+#endif
 
        if (ctx.options & DHCPCD_DUMPLEASE) {
                if (optind != argc) {