From e2cb2e749f132db85ed09efd047d41c6f663790f Mon Sep 17 00:00:00 2001 From: LiFeng Date: Wed, 27 Nov 2019 03:59:23 -0500 Subject: [PATCH] cgfsng: return attach fail if container stopped Signed-off-by: LiFeng --- src/lxc/cgroups/cgfsng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2