From 29a66510eb4f3af0e9a8aa1bbfd6f8172635e555 Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 30 Mar 2007 16:32:08 +0000 Subject: - 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 --- sys/geom/geom_ctl.c | 20 ++++++++++---------- 1 file 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); } -- cgit v1.1