Since the introduction of cdevs, this command returns 1 unconditionally.
Fix that up to return 0 on success and a more descriptive code
otherwise.
Fixes: a2b7cd183bad ("introduce cdev")
Signed-off-by: Ahmad Fatoum <[email protected]>
---
commands/partition.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/commands/partition.c b/commands/partition.c
index 7dd2fa629b6f..9444edac9e59 100644
--- a/commands/partition.c
+++ b/commands/partition.c
@@ -91,11 +91,11 @@ static int do_delpart(int argc, char *argv[])
err = devfs_del_partition(kbasename(argv[i]));
if (err) {
printf("cannot delete %s: %pe\n", argv[i],
ERR_PTR(err));
- break;
+ return err;
}
}
- return 1;
+ return 0;
}
BAREBOX_CMD_HELP_START(delpart)
--
2.47.3