diff options
author | Xin LI <delphij@FreeBSD.org> | 2007-03-30 16:32:08 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2007-03-30 16:32:08 +0000 |
commit | a92b7d4982aa1793ceea999035b52672de2560ae (patch) | |
tree | 61a4f75d7552394cba4986ecc22d579a57fb596e /sys/geom/geom_ctl.c | |
parent | b34b30c5af1b1dac01bec0e9b909de08baf49c49 (diff) | |
download | src-a92b7d4982aa1793ceea999035b52672de2560ae.tar.gz src-a92b7d4982aa1793ceea999035b52672de2560ae.zip |
- Be more verbose when saying "foo" not found.
- In gctl_get_geom(), don't issue error when we were not
provided with an parameter, like gctl_get_provider() did.
Reviewed by: pjd
Notes
Notes:
svn path=/head/; revision=168052
Diffstat (limited to 'sys/geom/geom_ctl.c')
-rw-r--r-- | sys/geom/geom_ctl.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c index 9c183b1fb8a4..25b9449bb008 100644 --- a/sys/geom/geom_ctl.c +++ b/sys/geom/geom_ctl.c @@ -398,17 +398,17 @@ gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char const *arg) struct g_geom *gp; p = gctl_get_asciiparam(req, arg); - if (p != NULL) { - LIST_FOREACH(mp, &g_classes, class) { - if (mpr != NULL && mpr != mp) - continue; - LIST_FOREACH(gp, &mp->geom, geom) { - if (!strcmp(p, gp->name)) - return (gp); - } + if (p == NULL) + return (NULL); + LIST_FOREACH(mp, &g_classes, class) { + if (mpr != NULL && mpr != mp) + continue; + LIST_FOREACH(gp, &mp->geom, geom) { + if (!strcmp(p, gp->name)) + return (gp); } } - gctl_error(req, "Geom not found"); + gctl_error(req, "Geom not found: \"%s\"", p); return (NULL); } @@ -424,7 +424,7 @@ gctl_get_provider(struct gctl_req *req, char const *arg) pp = g_provider_by_name(p); if (pp != NULL) return (pp); - gctl_error(req, "Provider not found"); + gctl_error(req, "Provider not found: \"%s\"", p); return (NULL); } |