- 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
This commit is contained in:
Xin LI 2007-03-30 16:32:08 +00:00
parent b34b30c5af
commit a92b7d4982
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168052

View File

@ -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);
}