]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgfsng: return attach fail if container stopped 3193/head
authorLiFeng <lifeng68@huawei.com>
Wed, 27 Nov 2019 08:59:23 +0000 (03:59 -0500)
committerLiFeng <lifeng68@huawei.com>
Wed, 27 Nov 2019 08:59:23 +0000 (03:59 -0500)
Signed-off-by: LiFeng <lifeng68@huawei.com>
src/lxc/cgroups/cgfsng.c

index 1e6a45cff2071ed073c4e44d4afc460f55b39e25..2ea9cec0345356ceb8c23416fdc68668041088cc 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);