Correct SYSINIT execution order in the case when KLD contains more

than one SYSINIT with the same 'subsystem' id and different 'order' id.

Reviewed by:	peter
This commit is contained in:
Boris Popov 2000-07-09 23:58:56 +00:00
parent b0f768ec1d
commit 2ff087318a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62860

View file

@ -127,7 +127,7 @@ linker_file_sysinit(linker_file_t lf)
*/
for (sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
for (xipp = sipp + 1; *xipp; xipp++) {
if ((*sipp)->subsystem <= (*xipp)->subsystem ||
if ((*sipp)->subsystem < (*xipp)->subsystem ||
((*sipp)->subsystem == (*xipp)->subsystem &&
(*sipp)->order <= (*xipp)->order))
continue; /* skip*/
@ -178,7 +178,7 @@ linker_file_sysuninit(linker_file_t lf)
*/
for (sipp = (struct sysinit **)sysuninits->ls_items; *sipp; sipp++) {
for (xipp = sipp + 1; *xipp; xipp++) {
if ((*sipp)->subsystem >= (*xipp)->subsystem ||
if ((*sipp)->subsystem > (*xipp)->subsystem ||
((*sipp)->subsystem == (*xipp)->subsystem &&
(*sipp)->order >= (*xipp)->order))
continue; /* skip*/