Add native modules to the loaded modules list.

Otherwise we'd reload/reinit libdoscalls.so (etc) for every module!
This commit is contained in:
Ryan C. Gordon committed 2016-10-05 15:52:11 -04:00
1 parent fae99dc048
commit 95d666c01b
1 file changed
+10
+10
View File
@@ -1085,6 +1085,16 @@ static LxModule *loadLxModuleByModuleNameInternal(const char *modname, const int
*ptr = (((*ptr >= 'A') && (*ptr <= 'Z')) ? (*ptr - ('A' - 'a')) : *ptr);
} // for
retval = loadNativeModule(fname, modname);
if (retval != NULL) {
// module is ready to use, put it in the loaded list.
// !!! FIXME: mutex this
if (GLoaderState->loaded_modules) {
retval->next = GLoaderState->loaded_modules;
GLoaderState->loaded_modules->prev = retval;
} // if
GLoaderState->loaded_modules = retval;
} // if
} // if
return retval;
} // loadLxModuleByModuleNameInternal