aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/mptutil/mptutil.c
diff options
context:
space:
mode:
authorRandi Harper <randi@FreeBSD.org>2010-10-10 20:37:38 +0000
committerRandi Harper <randi@FreeBSD.org>2010-10-10 20:37:38 +0000
commit4ee8bfc521a048d8fd318c9c7dbad129b0da87d7 (patch)
treecc5aaf64bb84c1ca82534a7526a5ce4a07cb4a67 /usr.sbin/mptutil/mptutil.c
parent7f79e870d26a5eff60127bb9d5608ae3471ed53e (diff)
downloadsrc-4ee8bfc521a048d8fd318c9c7dbad129b0da87d7.tar.gz
src-4ee8bfc521a048d8fd318c9c7dbad129b0da87d7.zip
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
Notes
Notes: svn path=/head/; revision=213672
Diffstat (limited to 'usr.sbin/mptutil/mptutil.c')
-rw-r--r--usr.sbin/mptutil/mptutil.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/mptutil/mptutil.c b/usr.sbin/mptutil/mptutil.c
index e7b58060ef1a..63e8efadd4b9 100644
--- a/usr.sbin/mptutil/mptutil.c
+++ b/usr.sbin/mptutil/mptutil.c
@@ -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);
}