summaryrefslogtreecommitdiff
path: root/cmds-replace.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-replace.c')
-rw-r--r--cmds-replace.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmds-replace.c b/cmds-replace.c
index 645dc988..9eb981ba 100644
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -449,7 +449,10 @@ static int print_replace_status(int fd, const char *path, int once)
break;
default:
prevent_loop = 1;
- assert(0);
+ fprintf(stderr,
+ "Unknown btrfs dev replace status:%llu",
+ status->replace_state);
+ ret = -EINVAL;
break;
}
@@ -459,9 +462,9 @@ static int print_replace_status(int fd, const char *path, int once)
(unsigned long long)status->num_write_errors,
(unsigned long long)
status->num_uncorrectable_read_errors);
- if (once || prevent_loop) {
+ if (once || prevent_loop || ret) {
printf("\n");
- return 0;
+ return ret;
}
fflush(stdout);