changeset 5451:840cdf8beeb8 draft

dhcpcd: avoid privsep errors if we error locking the pidfile Should not happen on the happy path, but if it does, tidy the resultant errors.
author Roy Marples <roy@marples.name>
date Fri, 11 Sep 2020 12:21:07 +0100
parents d976db099a39
children a351afa57787
files src/dhcpcd.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcpcd.c	Sun Sep 06 15:27:28 2020 +0100
+++ b/src/dhcpcd.c	Fri Sep 11 12:21:07 2020 +0100
@@ -2336,6 +2336,10 @@
 	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