Make sure we return an error message if the geom parameter is not

located.
This commit is contained in:
Poul-Henning Kamp 2003-06-07 15:31:44 +00:00
parent c283397793
commit b61e8fed30
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115958

View file

@ -389,14 +389,14 @@ 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)
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);
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);
}
}
}
gctl_error(req, "Geom not found");