]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Close ends of sigpipe not needed.
authorRoy Marples <roy@marples.name>
Fri, 29 Nov 2019 22:40:00 +0000 (22:40 +0000)
committerRoy Marples <roy@marples.name>
Fri, 29 Nov 2019 22:40:00 +0000 (22:40 +0000)
src/dhcpcd.c

index 7c8954be9cdd96635c72bb65cc3cd55295f419eb..a524ccb0edabd55429d36f6b67873d2c5aa960c8 100644 (file)
@@ -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;