close on exec, preparing for fork() stuff
This commit is contained in:
parent
752413ddc6
commit
4c27648393
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue