From: Christian Brauner Date: Sat, 24 Feb 2018 14:20:50 +0000 (+0100) Subject: lxccontainer: do_lxcapi_load_config() X-Git-Tag: lxc-3.0.0.beta1~15^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d03ab308a792b85bbcd6eb2b189e06e705d52767;p=thirdparty%2Flxc.git lxccontainer: do_lxcapi_load_config() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 4b0f37e62..13606c09f 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -595,9 +595,10 @@ static bool load_config_locked(struct lxc_container *c, const char *fname) static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file) { - bool ret = false, need_disklock = false; int lret; const char *fname; + bool need_disklock = false, ret = false; + if (!c) return false; @@ -606,10 +607,10 @@ static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file) fname = alt_file; if (!fname) return false; - /* - * If we're reading something other than the container's config, - * we only need to lock the in-memory container. If loading the - * container's config file, take the disk lock. + + /* If we're reading something other than the container's config, we only + * need to lock the in-memory container. If loading the container's + * config file, take the disk lock. */ if (strcmp(fname, c->configfile) == 0) need_disklock = true; @@ -627,6 +628,7 @@ static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file) container_disk_unlock(c); else container_mem_unlock(c); + return ret; }