]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
mainloop: use epoll_create1(EPOLL_CLOEXEC)
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 26 Dec 2017 19:57:12 +0000 (20:57 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Jan 2018 00:25:32 +0000 (01:25 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/mainloop.c

index 9afded97cbe519da50fab8bad9ffed6e16eaa794..84dfb39e968d1c51e2be7af9e7e06d818457c69a 100644 (file)
@@ -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;
 }