From: LiFeng Date: Wed, 27 Nov 2019 08:59:23 +0000 (-0500) Subject: cgfsng: return attach fail if container stopped X-Git-Tag: lxc-4.0.0~92^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2cb2e749f132db85ed09efd047d41c6f663790f;p=thirdparty%2Flxc.git cgfsng: return attach fail if container stopped Signed-off-by: LiFeng --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 1e6a45cff..2ea9cec03 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -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);