Commit ed05aac8 by Michael McCracken

storage: treat return value from ops->destroy as int

r->ops->destroy() returns an int, -1 on error. When assigned to a bool, this becomes true and hides errors. Signed-off-by: 's avatarMichael McCracken <mikmccra@cisco.com>
parent 7c76f495
...@@ -603,13 +603,14 @@ bool storage_destroy(struct lxc_conf *conf) ...@@ -603,13 +603,14 @@ bool storage_destroy(struct lxc_conf *conf)
{ {
struct lxc_storage *r; struct lxc_storage *r;
bool ret = false; bool ret = false;
int destroy_rv = 0;
r = storage_init(conf); r = storage_init(conf);
if (!r) if (!r)
return ret; return ret;
ret = r->ops->destroy(r); destroy_rv = r->ops->destroy(r);
if (ret == 0) if (destroy_rv == 0)
ret = true; ret = true;
storage_put(r); storage_put(r);
......
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