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:
Poul-Henning Kamp 2004-07-14 22:37:36 +00:00
parent 6f41379967
commit e2ad640e13
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132167

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