summaryrefslogtreecommitdiffstats
path: root/src/privsep-root.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2021-01-28 11:54:05 +0000
committerRoy Marples <roy@marples.name>2021-01-28 11:54:05 +0000
commit11baa2a1f51c8da51883ab341f6e00e4f73c6998 (patch)
tree4a069f765b1466d7e1e40003e73a716c12245429 /src/privsep-root.c
parent3ffb1dd5ee2a4962dd1384e00566996f791fcc78 (diff)
downloaddhcpcd-11baa2a1f51c8da51883ab341f6e00e4f73c6998.tar.xz
BSD: Implement kqueue(2) for eloop (again)
kqueue allows for O(1) processing of active fd's an a more robust signal handling method without the need to use global variables to avoid calling functions during signal delivery. The problems with the prior implemenation have now been fixed.
Diffstat (limited to 'src/privsep-root.c')
-rw-r--r--src/privsep-root.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/privsep-root.c b/src/privsep-root.c
index 70c6cf22..cfdcbb2c 100644
--- a/src/privsep-root.c
+++ b/src/privsep-root.c
@@ -853,6 +853,11 @@ int
ps_root_stop(struct dhcpcd_ctx *ctx)
{
+ if (!(ctx->options & DHCPCD_PRIVSEP) ||
+ ctx->options & DHCPCD_FORKED ||
+ ctx->eloop == NULL)
+ return 0;
+
return ps_dostop(ctx, &ctx->ps_root_pid, &ctx->ps_root_fd);
}