diff options
author | delphij <delphij@FreeBSD.org> | 2007-03-30 16:32:08 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2007-03-30 16:32:08 +0000 |
commit | 29a66510eb4f3af0e9a8aa1bbfd6f8172635e555 (patch) | |
tree | 61a4f75d7552394cba4986ecc22d579a57fb596e /sys | |
parent | 83871cf425c75b70c87a7a0b7647087ad4aa0b0f (diff) | |
download | FreeBSD-src-29a66510eb4f3af0e9a8aa1bbfd6f8172635e555.zip FreeBSD-src-29a66510eb4f3af0e9a8aa1bbfd6f8172635e555.tar.gz |
- 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
Diffstat (limited to 'sys')
-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 9c183b1..25b9449 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); } |