close on exec, preparing for fork() stuff

This commit is contained in:
Andreas Öman 2008-02-21 20:17:27 +00:00
parent 752413ddc6
commit 4c27648393

View 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;