summaryrefslogtreecommitdiff
path: root/cmds-rescue.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-rescue.c')
-rw-r--r--cmds-rescue.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/cmds-rescue.c b/cmds-rescue.c
index e18eb989..f20a2068 100644
--- a/cmds-rescue.c
+++ b/cmds-rescue.c
@@ -80,9 +80,13 @@ int cmd_chunk_recover(int argc, char *argv[])
file = argv[optind];
ret = check_mounted(file);
- if (ret) {
+ if (ret < 0) {
+ fprintf(stderr, "Could not check mount status: %s\n",
+ strerror(-ret));
+ return 1;
+ } else if (ret) {
fprintf(stderr, "the device is busy\n");
- return ret;
+ return 1;
}
ret = btrfs_recover_chunk_tree(file, verbose, yes);
@@ -133,7 +137,11 @@ int cmd_super_recover(int argc, char **argv)
dname = argv[optind];
ret = check_mounted(dname);
- if (ret) {
+ if (ret < 0) {
+ fprintf(stderr, "Could not check mount status: %s\n",
+ strerror(-ret));
+ return 1;
+ } else if (ret) {
fprintf(stderr, "the device is busy\n");
return 1;
}