summaryrefslogtreecommitdiffstats
path: root/loader/modules.c
diff options
context:
space:
mode:
Diffstat (limited to 'loader/modules.c')
-rw-r--r--loader/modules.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/loader/modules.c b/loader/modules.c
index bb65e6244..e7d3b2844 100644
--- a/loader/modules.c
+++ b/loader/modules.c
@@ -165,25 +165,35 @@ static int moduleLoaded(moduleList modList, const char * name) {
}
int mlLoadModule(struct moduleInfo * modInfo, moduleList modLoaded,
- moduleDeps modDeps) {
+ moduleDeps modDeps, int testing) {
moduleDeps dep;
char ** nextDep;
+ char modName[80];
+ int rc;
+
for (dep = modDeps; dep->name && strcmp(dep->name, modInfo->moduleName);
dep++);
- if (dep) {
+ if (dep && dep->deps) {
nextDep = dep->deps;
while (*nextDep) {
if (!moduleLoaded(modLoaded, *nextDep)) {
- insmod(*nextDep, NULL);
+ sprintf(modName, "%s.o", *nextDep);
+ if (!testing) insmod(*nextDep, NULL);
}
dep++;
}
}
- return insmod(modInfo->moduleName, NULL);
+ if (testing) return 0;
+
+ sprintf(modName, "%s.o", modInfo->moduleName);
+
+ rc = insmod(modName, NULL);
+ sleep(2);
+ return rc;
}
char ** mlGetDeps(moduleDeps modDeps, const char * modName) {