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:
parent
ea079c2c7b
commit
6aa084aa4f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user