From: Roy Marples Date: Fri, 29 Nov 2019 22:40:00 +0000 (+0000) Subject: Close ends of sigpipe not needed. X-Git-Tag: v9.0.0~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d08308fdb79268254f1902df0a8c8b6e9bf1a14;p=thirdparty%2Fdhcpcd.git Close ends of sigpipe not needed. --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 7c8954be..a524ccb0 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -2002,6 +2002,7 @@ printpidfile: goto exit_failure; case 0: ctx.fork_fd = sigpipe[1]; + close(sigpipe[0]); if (setsid() == -1) { logerr("%s: setsid", __func__); goto exit_failure; @@ -2024,6 +2025,7 @@ printpidfile: waitpid(pid, &i, 0); ctx.options |= DHCPCD_FORKED; /* A lie */ ctx.fork_fd = sigpipe[0]; + close(sigpipe[1]); setproctitle("[launcher]"); eloop_event_add(ctx.eloop, ctx.fork_fd, dhcpcd_fork_cb, &ctx); goto run_loop;