From: Roy Marples Date: Tue, 7 Feb 2023 16:39:00 +0000 (+0000) Subject: privsep: Don't try to unlink the pidfile in test mode X-Git-Tag: v10.0.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=931c168e91d9ffaf1ed2f497d02d24dd5875790b;p=thirdparty%2Fdhcpcd.git privsep: Don't try to unlink the pidfile in test mode --- diff --git a/src/privsep-root.c b/src/privsep-root.c index db445ec4..c6351821 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -945,7 +945,9 @@ ps_root_stop(struct dhcpcd_ctx *ctx) return 0; /* If we are the root process then remove the pidfile */ - if (ctx->options & DHCPCD_PRIVSEPROOT) { + if (ctx->options & DHCPCD_PRIVSEPROOT && + !(ctx->options & DHCPCD_TEST)) + { if (unlink(ctx->pidfile) == -1) logerr("%s: unlink: %s", __func__, ctx->pidfile); }