o Don't cause a panic when the control request lacks a verb.

o  Don't set the error twice when the named class does not exist.
   It causes ioctl(2) to return with error EEXIST.
This commit is contained in:
Marcel Moolenaar 2005-09-18 23:54:40 +00:00
parent 73130b2224
commit 40fcaded53
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150304

View File

@ -371,7 +371,6 @@ gctl_get_class(struct gctl_req *req, char const *arg)
if (!strcmp(p, cp->name))
return (cp);
}
gctl_error(req, "Class not found");
return (NULL);
}
@ -427,11 +426,16 @@ g_ctl_req(void *arg, int flag __unused)
gctl_error(req, "Class not found");
return;
}
verb = gctl_get_param(req, "verb", NULL);
if (mp->ctlreq == NULL)
if (mp->ctlreq == NULL) {
gctl_error(req, "Class takes no requests");
else
mp->ctlreq(req, mp, verb);
return;
}
verb = gctl_get_param(req, "verb", NULL);
if (verb == NULL) {
gctl_error(req, "Verb missing");
return;
}
mp->ctlreq(req, mp, verb);
g_topology_assert();
}