From: Christian Brauner Date: Tue, 26 Dec 2017 19:57:12 +0000 (+0100) Subject: mainloop: use epoll_create1(EPOLL_CLOEXEC) X-Git-Tag: lxc-3.0.0.beta1~90^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2062%2Fhead;p=thirdparty%2Flxc.git mainloop: use epoll_create1(EPOLL_CLOEXEC) Signed-off-by: Christian Brauner --- diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c index 9afded97c..84dfb39e9 100644 --- a/src/lxc/mainloop.c +++ b/src/lxc/mainloop.c @@ -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; }