summaryrefslogtreecommitdiff
path: root/cmds-restore.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-06-19 09:27:06 +0800
committerDavid Sterba <dsterba@suse.cz>2014-08-22 14:43:09 +0200
commitc2059f765d4ccd03072bdbd808687b2d4298c433 (patch)
treee82be114fa7450cd8e41547208e5c657d97955d8 /cmds-restore.c
parentd46111425af47a981145862a5d01d7b5ef5d65e3 (diff)
btrfs-progs: restore: fix wrong return value if it fails to read specified fs root
Steps to reproduce: # mkfs.btrfs -f /dev/sda9 # btrfs restore -f 1 -o /tmp /dev/sda9 # echo $? Fix to return 1 in this failure path. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-restore.c')
-rw-r--r--cmds-restore.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmds-restore.c b/cmds-restore.c
index c84ac17d..52c79f9f 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -1239,6 +1239,7 @@ int cmd_restore(int argc, char **argv)
root->node = read_tree_block(root, fs_location, root->leafsize, 0);
if (!root->node) {
fprintf(stderr, "Failed to read fs location\n");
+ ret = 1;
goto out;
}
}