From: Ian Jackson Date: Wed, 1 Oct 2014 17:20:44 +0000 (+0100) Subject: polypath: Close parent's socket in child X-Git-Tag: base.ipv6-polypath-fixes.v1~19 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=94a1d5fce6a68fce8216d4b45ef6148d353c2c3a 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 770ffc2..58a89ee 100644 --- a/polypath.c +++ b/polypath.c @@ -475,6 +475,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(); }