]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: avoid privsep errors if we error locking the pidfile
authorRoy Marples <roy@marples.name>
Fri, 11 Sep 2020 11:21:07 +0000 (12:21 +0100)
committerRoy Marples <roy@marples.name>
Fri, 11 Sep 2020 11:21:07 +0000 (12:21 +0100)
Should not happen on the happy path, but if it does, tidy the
resultant errors.

src/dhcpcd.c

index ba0c905a75839528a8bb0049027699e32d04051e..f80d293ac3afab081f40fb9eea1616c2e00613ce 100644 (file)
@@ -2336,6 +2336,10 @@ printpidfile:
        ctx.options |= DHCPCD_STARTED;
        if ((pid = pidfile_lock(ctx.pidfile)) != 0) {
                logerr("%s: pidfile_lock %d", __func__, pid);
+#ifdef PRIVSEP
+               /* privsep has not started ... */
+               ctx.options &= ~DHCPCD_PRIVSEP;
+#endif
                goto exit_failure;
        }
 #endif