mainloop: use epoll_create1(EPOLL_CLOEXEC)

parent a63fade5
...@@ -134,15 +134,10 @@ int lxc_mainloop_del_handler(struct lxc_epoll_descr *descr, int fd) ...@@ -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) int lxc_mainloop_open(struct lxc_epoll_descr *descr)
{ {
/* hint value passed to epoll create */ /* hint value passed to epoll create */
descr->epfd = epoll_create(2); descr->epfd = epoll_create1(EPOLL_CLOEXEC);
if (descr->epfd < 0) if (descr->epfd < 0)
return -1; return -1;
if (fcntl(descr->epfd, F_SETFD, FD_CLOEXEC)) {
close(descr->epfd);
return -1;
}
lxc_list_init(&descr->handlers); lxc_list_init(&descr->handlers);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment