mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
Report subcommand handler errors in mfiutil/mptutil so that tools that
invoke the utilities can robustly report errors. Submitted by: gcooper Reviewed by: jhb Approved by: cperciva (mentor) MFC after: 1 week
This commit is contained in:
parent
7f79e870d2
commit
4ee8bfc521
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213672
@ -125,10 +125,12 @@ main(int ac, char **av)
|
||||
|
||||
SET_FOREACH(cmd, MFI_DATASET(top)) {
|
||||
if (strcmp((*cmd)->name, av[0]) == 0) {
|
||||
(*cmd)->handler(ac, av);
|
||||
return (0);
|
||||
if ((*cmd)->handler(ac, av))
|
||||
return (1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
warnx("Unknown command %s.", av[0]);
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
@ -114,10 +114,12 @@ main(int ac, char **av)
|
||||
|
||||
SET_FOREACH(cmd, MPT_DATASET(top)) {
|
||||
if (strcmp((*cmd)->name, av[0]) == 0) {
|
||||
(*cmd)->handler(ac, av);
|
||||
return (0);
|
||||
if ((*cmd)->handler(ac, av))
|
||||
return (1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
warnx("Unknown command %s.", av[0]);
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user