about summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'chat.c')
-rw-r--r--chat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chat.c b/chat.c
index ca35d7d..c0c2d28 100644
--- a/chat.c
+++ b/chat.c
@@ -16,6 +16,7 @@
 
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <locale.h>
 #include <poll.h>
 #include <signal.h>
@@ -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 },