lxccontainer: do_lxcapi_is_defined()

parent 045552aa
...@@ -353,24 +353,28 @@ int lxc_container_put(struct lxc_container *c) ...@@ -353,24 +353,28 @@ int lxc_container_put(struct lxc_container *c)
static bool do_lxcapi_is_defined(struct lxc_container *c) static bool do_lxcapi_is_defined(struct lxc_container *c)
{ {
int statret;
struct stat statbuf; struct stat statbuf;
bool ret = false; bool ret = false;
int statret;
if (!c) if (!c)
return false; return false;
if (container_mem_lock(c)) if (container_mem_lock(c))
return false; return false;
if (!c->configfile) if (!c->configfile)
goto out; goto on_error;
statret = stat(c->configfile, &statbuf); statret = stat(c->configfile, &statbuf);
if (statret != 0) if (statret != 0)
goto out; goto on_error;
ret = true; ret = true;
out: on_error:
container_mem_unlock(c); container_mem_unlock(c);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment