From: Rikard Falkeborn Date: Sat, 11 May 2019 23:47:56 +0000 (+0200) Subject: zfs: Fix return value on zfs_snapshot error X-Git-Tag: lxc-3.2.0~54^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2998%2Fhead;p=thirdparty%2Flxc.git zfs: Fix return value on zfs_snapshot error Returning -1 in a function with return type bool is the same as returning true. Change to return false to indicate error properly. Detected with cppcheck. Signed-off-by: Rikard Falkeborn --- diff --git a/src/lxc/storage/zfs.c b/src/lxc/storage/zfs.c index b75708f1c..fc3b32247 100644 --- a/src/lxc/storage/zfs.c +++ b/src/lxc/storage/zfs.c @@ -427,7 +427,7 @@ bool zfs_snapshot(struct lxc_conf *conf, struct lxc_storage *orig, if (ret < 0 || ret >= PATH_MAX) { ERROR("Failed to create string"); free(snapshot); - return -1; + return false; } cmd_args.dataset = lxc_storage_get_path(new->src, new->type);