Skip to content

Commit

Permalink
mainloop: use epoll_create1(EPOLL_CLOEXEC)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Jan 2, 2018
1 parent 3a6b6e1 commit 20c4a52
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lxc/mainloop.c
Expand Up @@ -134,15 +134,10 @@ int lxc_mainloop_del_handler(struct lxc_epoll_descr *descr, int fd)
int lxc_mainloop_open(struct lxc_epoll_descr *descr)
{
/* hint value passed to epoll create */
descr->epfd = epoll_create(2);
descr->epfd = epoll_create1(EPOLL_CLOEXEC);
if (descr->epfd < 0)
return -1;

if (fcntl(descr->epfd, F_SETFD, FD_CLOEXEC)) {
close(descr->epfd);
return -1;
}

lxc_list_init(&descr->handlers);
return 0;
}
Expand Down

0 comments on commit 20c4a52

Please sign in to comment.