From: Michel Normand Date: Fri, 13 Nov 2009 10:48:29 +0000 (+0100) Subject: stop config reading if cgroup setting failed X-Git-Tag: lxc_0_6_4~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88329c69cd119535e5d3ec400f275aad35f8b6cc;p=thirdparty%2Flxc.git stop config reading if cgroup setting failed in today's code lxc-start to not stop if setup_cgroup is detecting an error Signed-off-by: Michel Normand Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 4c74734ab..6930f76b9 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -457,6 +457,7 @@ static int setup_cgroup(const char *name, struct lxc_list *cgroups) { struct lxc_list *iterator; struct lxc_cgroup *cg; + int ret = -1; if (lxc_list_empty(cgroups)) return 0; @@ -466,14 +467,15 @@ static int setup_cgroup(const char *name, struct lxc_list *cgroups) cg = iterator->elem; if (lxc_cgroup_set(name, cg->subsystem, cg->value)) - break; + goto out; DEBUG("cgroup '%s' set to '%s'", cg->subsystem, cg->value); } + ret = 0; INFO("cgroup has been setup"); - - return 0; +out: + return ret; } static void parse_mntopt(char *opt, unsigned long *flags, char **data)