From 362d779b61adc3f59ef7b4617b3bb7a19f024048 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Sat, 8 Feb 2020 19:12:05 -0500 Subject: Set FDs CLOEXEC --- chat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chat.c b/chat.c index ca35d7d..c0c2d28 100644 --- a/chat.c +++ b/chat.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -164,6 +165,10 @@ int main(int argc, char *argv[]) { int error = pipe(procPipe); if (error) err(EX_OSERR, "pipe"); + fcntl(irc, F_SETFD, FD_CLOEXEC); + fcntl(procPipe[0], F_SETFD, FD_CLOEXEC); + fcntl(procPipe[1], F_SETFD, FD_CLOEXEC); + struct pollfd fds[3] = { { .events = POLLIN, .fd = STDIN_FILENO }, { .events = POLLIN, .fd = irc }, -- cgit 1.4.1-2-gfad0