From: Ian Jackson Date: Wed, 1 Oct 2014 17:20:44 +0000 (+0100) Subject: polypath: Close parent's socket in child X-Git-Tag: proposed.polypath.v3~9 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=02f4a4c7f8c77df8e49cf63b9371545cb5124fd4;p=secnet.git polypath: Close parent's socket in child Previously this would happen automatically due to CLOEXEC, but we are going to have a long-running child, which needs to not have a copy of this fd. Signed-off-by: Ian Jackson --- diff --git a/polypath.c b/polypath.c index a07bdfc..8b60ac2 100644 --- a/polypath.c +++ b/polypath.c @@ -474,6 +474,7 @@ static void start_subproc(struct polypath *st, void (*make_fdpair)(int[2]), pid_t pid=fork(); if (!pid) { afterfork(); + close(pfds[0]); child(st,pfds[1]); abort(); }