From: Michael McCracken Date: Fri, 19 Jan 2018 16:38:36 +0000 (-0800) Subject: storage: treat return value from ops->destroy as int X-Git-Tag: lxc-3.0.0.beta1~71^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2097%2Fhead;p=thirdparty%2Flxc.git 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: Michael McCracken --- diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c index 98aa031b7..e080ad87a 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -603,13 +603,14 @@ bool storage_destroy(struct lxc_conf *conf) { struct lxc_storage *r; bool ret = false; + int destroy_rv = 0; r = storage_init(conf); if (!r) return ret; - ret = r->ops->destroy(r); - if (ret == 0) + destroy_rv = r->ops->destroy(r); + if (destroy_rv == 0) ret = true; storage_put(r);