A module with no modevent function gets modevent_nop() as default.

Until now the function has just returned zero for any event, but
that is downright wrong for MOD_UNLOAD and not very useful for any
future events we add where it may be crucial to be able to tell
if the event was unhandled or successful.

Change the function to return as follows:

	MOD_LOAD -> 0
	MOD_UNLOAD -> EBUSY
	anything else -> EOPNOTSUPP
This commit is contained in:
phk 2004-07-14 22:37:36 +00:00
parent ea079c2c7b
commit 6aa084aa4f

View File

@ -66,7 +66,15 @@ static void module_shutdown(void *, int);
static int
modevent_nop(module_t mod, int what, void *arg)
{
return (0);
switch(what) {
case MOD_LOAD:
return (0);
case MOD_UNLOAD:
return (EBUSY);
default:
return (EOPNOTSUPP);
}
}
static void