summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-11-29 22:40:00 +0000
committerRoy Marples <roy@marples.name>2019-11-29 22:40:00 +0000
commiteba30278ff97dd5a35cf736ece609e61375b05e6 (patch)
tree1733900fb9abfac5851a2683abd3e9442424049a /src/dhcpcd.c
parent3063ebb6c8ac7c96196fa923cdd5f7c0384de23b (diff)
downloaddhcpcd-eba30278ff97dd5a35cf736ece609e61375b05e6.tar.xz
Close ends of sigpipe not needed.
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c2
1 files changed, 2 insertions, 0 deletions
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;