From 0a786ffbb9d293d7704b8e264f3943a616ed25cc Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 21 May 2015 11:06:38 +0200 Subject: [PATCH] Set the CLOEXEC flag on the umbilical socket. --- src/tincd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tincd.c b/src/tincd.c index b62c8c1..14a0c11 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -370,6 +370,10 @@ int main(int argc, char **argv) { umbilical = atoi(umbstr); if(fcntl(umbilical, F_GETFL) < 0) umbilical = 0; +#ifdef FD_CLOEXEC + if(umbilical) + fcntl(umbilical, F_SETFD, FD_CLOEXEC); +#endif } #endif -- 2.25.1