Mercurial > hg > dhcpcd
changeset 4968:34d8fe622a9a draft
dhcpcd: Ignore SIGPIPE, prefer EPIPE.
This is mainly to get dhcpcd running in privsep on my ERLITE
router running some NetBSD pre-9 branch.
So far, seems harmless....
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Thu, 16 Jan 2020 03:20:53 +0000 |
| parents | e137c0aa1068 |
| children | 110a9735e7a1 |
| files | src/dhcpcd.c |
| diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dhcpcd.c Wed Jan 15 19:16:58 2020 +0000 +++ b/src/dhcpcd.c Thu Jan 16 03:20:53 2020 +0000 @@ -81,7 +81,6 @@ SIGHUP, SIGUSR1, SIGUSR2, - SIGPIPE }; const size_t dhcpcd_signals_len = __arraycount(dhcpcd_signals); #endif @@ -1374,9 +1373,6 @@ if (logopen(ctx->logfile) == -1) logerr(__func__); return; - case SIGPIPE: - logwarnx("received SIGPIPE"); - return; default: logerrx("received signal %d but don't know what to do with it", sig); @@ -1842,7 +1838,11 @@ logerr("%s: eloop_init", __func__); goto exit_failure; } + #ifdef USE_SIGNALS + /* Ingore SIGPIPE, prefer EPIPE. */ + signal(SIGPIPE, SIG_IGN); + /* Save signal mask, block and redirect signals to our handler */ if (eloop_signal_set_cb(ctx.eloop, dhcpcd_signals, dhcpcd_signals_len,
