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
6f41379967
commit
e2ad640e13
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132167
@ -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…
Reference in New Issue
Block a user