]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: check for ENOCGROUP2 explicitly
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 21:23:45 +0000 (22:23 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 21:56:10 +0000 (22:56 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index 5f8114b2f55b0e3ebc0d845e31a90b570343bf86..ee18bfa3ebc34bd0fc7f333990736e461c042792 100644 (file)
@@ -1522,7 +1522,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
                 * enough.
                 */
                ret = cgroup_attach(conf, name, lxcpath, pid);
-               if (ret) {
+               if (ret == -ENOCGROUP2) {
                        call_cleaner(cgroup_exit) struct cgroup_ops *cgroup_ops = NULL;
 
                        cgroup_ops = cgroup_init(conf);