From aaf03176afbb244079e967d9f3c7aa7fbc03bb85 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Wed, 4 Sep 2013 23:22:31 +0800 Subject: [PATCH] Btrfs-progs: fix magic return value in btrfs-zero-log.c Signed-off-by: Wang Shilong Signed-off-by: David Sterba Signed-off-by: Chris Mason --- btrfs-zero-log.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/btrfs-zero-log.c b/btrfs-zero-log.c index f249aec..31ec215 100644 --- a/btrfs-zero-log.c +++ b/btrfs-zero-log.c @@ -52,10 +52,11 @@ int main(int ac, char **av) if((ret = check_mounted(av[1])) < 0) { fprintf(stderr, "Could not check mount status: %s\n", strerror(-ret)); - return ret; + goto out; } else if(ret) { fprintf(stderr, "%s is currently mounted. Aborting.\n", av[1]); - return -EBUSY; + ret = -EBUSY; + goto out; } root = open_ctree(av[1], 0, 1); @@ -68,5 +69,6 @@ int main(int ac, char **av) btrfs_set_super_log_root_level(root->fs_info->super_copy, 0); btrfs_commit_transaction(trans, root); close_ctree(root); - return ret; +out: + return !!ret; } -- 2.7.4