summaryrefslogtreecommitdiffstats
path: root/loader/modules.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-07-28 16:08:18 +0000
committerErik Troan <ewt@redhat.com>1999-07-28 16:08:18 +0000
commit7f8b0446239bbfaa13f37f388d94f92b9c304d5b (patch)
tree46306206e9391f7c4d92103650a9a3da79cde9cf /loader/modules.c
parent03050ef1ee350c9fa4c49484423b7f9a0085e2de (diff)
downloadanaconda-7f8b0446239bbfaa13f37f388d94f92b9c304d5b.tar.gz
anaconda-7f8b0446239bbfaa13f37f388d94f92b9c304d5b.tar.xz
anaconda-7f8b0446239bbfaa13f37f388d94f92b9c304d5b.zip
added mlModuleInList()
Diffstat (limited to 'loader/modules.c')
-rw-r--r--loader/modules.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/loader/modules.c b/loader/modules.c
index dc5b60e5d..9178a6708 100644
--- a/loader/modules.c
+++ b/loader/modules.c
@@ -22,8 +22,6 @@ struct moduleList_s {
int numModules;
};
-static int moduleLoaded(moduleList modList, const char * name);
-
int mlReadLoadedList(moduleList * mlp) {
int fd;
char * start;
@@ -156,17 +154,6 @@ int mlLoadDeps(moduleDeps moduleDepList, const char * path) {
return 0;
}
-static int moduleLoaded(moduleList modList, const char * name) {
- int i;
-
- if (!modList) return 0;
-
- for (i = 0; i < modList->numModules; i++)
- if (!strcmp(modList->modules[i], name)) return 1;
-
- return 0;
-}
-
int mlLoadModule(char * modName, moduleList modLoaded,
moduleDeps modDeps, int testing) {
moduleDeps dep;
@@ -174,7 +161,7 @@ int mlLoadModule(char * modName, moduleList modLoaded,
char fileName[80];
int rc;
- if (moduleLoaded(modLoaded, modName)) {
+ if (mlModuleInList(modName, modLoaded)) {
return 0;
}
@@ -184,9 +171,7 @@ int mlLoadModule(char * modName, moduleList modLoaded,
if (dep && dep->deps) {
nextDep = dep->deps;
while (*nextDep) {
- if (!moduleLoaded(modLoaded, *nextDep)) {
- mlLoadModule(*nextDep, modLoaded, modDeps, testing);
- }
+ mlLoadModule(*nextDep, modLoaded, modDeps, testing);
nextDep++;
}
@@ -212,3 +197,14 @@ char ** mlGetDeps(moduleDeps modDeps, const char * modName) {
return NULL;
}
+
+int mlModuleInList(const char * modName, moduleList list) {
+ int i;
+
+ if (!list) return 0;
+
+ for (i = 0; i < list->numModules; i++)
+ if (!strcmp(list->modules[i], modName)) return 1;
+
+ return 0;
+}