diff options
| author | Roy Marples <roy@marples.name> | 2020-06-03 23:30:08 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-06-03 23:30:08 +0100 |
| commit | 2f16f1f6245649b1784da9835ff580d280ede1bf (patch) | |
| tree | e6f8626eb44245b0ba7c81af6a5fcff2c9cbbd75 /src/privsep-root.c | |
| parent | fbb2366d5f207118bfeab76413efe96d4fcfd6f8 (diff) | |
| download | dhcpcd-2f16f1f6245649b1784da9835ff580d280ede1bf.tar.xz | |
eloop: Just use ppoll(2)
epoll and kqueue are really too heavy weight.
With privsep, we now favour more processes for BPF and per address sockets.
As such, the number of fds to monitor will always be quite small.
All modern OS now have ppoll(2) (NetBSD has pollts, which is the same)
which works perfectly for us.
If neither are present, the a wrapper around pselect(2) is provided,
which can be found on all POSIX systems.
This makes the code a lot smaller and easier to follow.
The reduced binary size and memory usage is a nice win here.
Diffstat (limited to 'src/privsep-root.c')
| -rw-r--r-- | src/privsep-root.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/privsep-root.c b/src/privsep-root.c index ae52c6ed..93cb8a29 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -788,10 +788,9 @@ ps_root_start(struct dhcpcd_ctx *ctx) if ((ctx->ps_eloop = eloop_new()) == NULL) return -1; - if (eloop_signal_set_cb(ctx->ps_eloop, + eloop_signal_set_cb(ctx->ps_eloop, dhcpcd_signals, dhcpcd_signals_len, - ps_root_readerrorsig, ctx) == -1) - return -1; + ps_root_readerrorsig, ctx); return pid; } |
