]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgfsng: return attach fail if container stopped
authorLiFeng <lifeng68@huawei.com>
Wed, 27 Nov 2019 08:59:23 +0000 (03:59 -0500)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 2 Dec 2019 13:07:27 +0000 (14:07 +0100)
Signed-off-by: LiFeng <lifeng68@huawei.com>
src/lxc/cgroups/cgfsng.c

index efddc13ae18669615cc580d06923d0c2db30d484..dfd71c2a6dd58651709805919c5a5bd5f3e5cf76 100644 (file)
@@ -2223,7 +2223,7 @@ __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, const char *name,
                path = lxc_cmd_get_cgroup_path(name, lxcpath, h->controllers[0]);
                /* not running */
                if (!path)
-                       continue;
+                       return false;
 
                fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs");
                ret = lxc_write_to_file(fullpath, pidstr, len, false, 0666);