mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-27 12:03:45 +08:00
privsep: move setting signals to after clearing eloop
This commit is contained in:
parent
534eb959e8
commit
3ffb1dd5ee
@ -369,7 +369,15 @@ ps_dostart(struct dhcpcd_ctx *ctx,
|
||||
ctx->fork_fd = -1;
|
||||
}
|
||||
pidfile_clean();
|
||||
|
||||
eloop_clear(ctx->eloop);
|
||||
eloop_signal_set_cb(ctx->eloop,
|
||||
dhcpcd_signals, dhcpcd_signals_len, signal_cb, ctx);
|
||||
/* ctx->sigset aready has the initial sigmask set in main() */
|
||||
if (eloop_signal_mask(ctx->eloop, NULL) == -1) {
|
||||
logerr("%s: eloop_signal_mask", __func__);
|
||||
goto errexit;
|
||||
}
|
||||
|
||||
/* We are not root */
|
||||
if (priv_fd != &ctx->ps_root_fd) {
|
||||
@ -393,15 +401,6 @@ ps_dostart(struct dhcpcd_ctx *ctx,
|
||||
ctx->ps_inet_fd = -1;
|
||||
}
|
||||
|
||||
eloop_signal_set_cb(ctx->eloop,
|
||||
dhcpcd_signals, dhcpcd_signals_len, signal_cb, ctx);
|
||||
|
||||
/* ctx->sigset aready has the initial sigmask set in main() */
|
||||
if (eloop_signal_mask(ctx->eloop, NULL) == -1) {
|
||||
logerr("%s: eloop_signal_mask", __func__);
|
||||
goto errexit;
|
||||
}
|
||||
|
||||
if (eloop_event_add(ctx->eloop, *priv_fd, recv_msg, recv_ctx) == -1)
|
||||
{
|
||||
logerr("%s: eloop_event_add", __func__);
|
||||
|
Loading…
Reference in New Issue
Block a user