summaryrefslogtreecommitdiff
path: root/ubi-utils/ubinfo.c
diff options
context:
space:
mode:
authorAndrew Mellor <andrew.mellor@casa-systems.com>2022-06-06 16:38:46 +1000
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-06-13 13:39:05 +0200
commit9beb813521d23d7f957fc80c6603810893c8ee53 (patch)
treebcde52c7f4e447d573c7e501d40a4bbb879e3576 /ubi-utils/ubinfo.c
parentf79d2b21614f11ea9f99dc5a3155d23439cec773 (diff)
ubinfo: Fix --vol_id return code for absent volume id
When using --vol_id and that volume is missing, it should return non-zero like the --name option does. Signed-off-by: Andrew Mellor <andrew.mellor@casa-systems.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubi-utils/ubinfo.c')
-rw-r--r--ubi-utils/ubinfo.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ubi-utils/ubinfo.c b/ubi-utils/ubinfo.c
index 29530be..53519cc 100644
--- a/ubi-utils/ubinfo.c
+++ b/ubi-utils/ubinfo.c
@@ -417,12 +417,9 @@ int main(int argc, char * const argv[])
goto out_libubi;
}
- if (args.devn != -1 && args.vol_id != -1) {
- print_vol_info(libubi, args.devn, args.vol_id);
- goto out;
- }
-
- if (args.devn == -1 && args.vol_id == -1)
+ if (args.devn != -1 && args.vol_id != -1)
+ err = print_vol_info(libubi, args.devn, args.vol_id);
+ else if (args.devn == -1 && args.vol_id == -1)
err = print_general_info(libubi, args.all);
else if (args.devn != -1 && args.vol_id == -1)
err = print_dev_info(libubi, args.devn, args.all);