]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
close on exec, preparing for fork() stuff
authorAndreas Öman <andreas@lonelycoder.com>
Thu, 21 Feb 2008 20:17:27 +0000 (20:17 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Thu, 21 Feb 2008 20:17:27 +0000 (20:17 +0000)
dispatch.c

index f4a8df0bcb5d7ab2dfbb4bd03d1b193ac90ab408..b70b0776da9bb994740c4d59c63fb5ea3cd99bbd 100644 (file)
@@ -127,6 +127,8 @@ dispatch_addfd(int fd, void (*callback)(int events, void *opaque, int fd),
 {
   struct epoll_entry *e;
 
+  fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
+
   e = calloc(1, sizeof(struct epoll_entry));
   e->callback = callback;
   e->opaque = opaque;