]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgfsng: use EPOLLPRI when polling cgroup.events 3413/head
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 15 May 2020 13:07:35 +0000 (15:07 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 15 May 2020 13:07:36 +0000 (15:07 +0200)
EPOLLIN will always be true and therefore end up
busy-looping

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lxc/cgroups/cgfsng.c

index 7136d27a877c6c2d1f823f3666d19b7553da591d..f7af7c0a50f94b8aa58ebc632222eb0292503dc0 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/epoll.h>
 #include <sys/types.h>
 #include <unistd.h>
 
@@ -2076,7 +2077,7 @@ static int cg_unified_freeze_do(struct cgroup_ops *ops, int timeout,
                /* automatically cleaned up now */
                descr_ptr = &descr;
 
-               ret = lxc_mainloop_add_handler(&descr, fd, freezer_cgroup_events_cb, INT_TO_PTR(state_num));
+               ret = lxc_mainloop_add_handler_events(&descr, fd, EPOLLPRI, freezer_cgroup_events_cb, INT_TO_PTR(state_num));
                if (ret < 0)
                        return log_error_errno(-1, errno, "Failed to add cgroup.events fd handler to mainloop");
        }