From cdcaad486806b9c892fe3c050444e65c593c4c06 Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Sun, 12 May 2019 01:47:56 +0200 Subject: [PATCH] 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 --- src/lxc/storage/zfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2