Clean up a warning, and remove excess multiple-suffix code.
This commit is contained in:
parent
6d594ebc66
commit
97203f1cf6
|
@ -272,7 +272,7 @@ static loader_funcs funcs[] = {
|
||||||
DLResolveSymbols,
|
DLResolveSymbols,
|
||||||
DLCheckForUnresolved,
|
DLCheckForUnresolved,
|
||||||
ARCHIVEAddressToSection,
|
ARCHIVEAddressToSection,
|
||||||
DLUnloadModule, {0, 0, 0, 0, 0}},
|
DLUnloadModule, {0, 0}},
|
||||||
};
|
};
|
||||||
|
|
||||||
int numloaders = sizeof(funcs) / sizeof(loader_funcs);
|
int numloaders = sizeof(funcs) / sizeof(loader_funcs);
|
||||||
|
|
|
@ -413,7 +413,6 @@ FindModule(const char *module, const char *dir, const char **subdirlist,
|
||||||
int dirlen;
|
int dirlen;
|
||||||
const char **subdirs = NULL;
|
const char **subdirs = NULL;
|
||||||
const char **s;
|
const char **s;
|
||||||
const char suffix[3][3] = { "so", "a", "o" };
|
|
||||||
|
|
||||||
#ifndef __EMX__
|
#ifndef __EMX__
|
||||||
dirpath = (char *)dir;
|
dirpath = (char *)dir;
|
||||||
|
@ -441,29 +440,24 @@ FindModule(const char *module, const char *dir, const char **subdirlist,
|
||||||
buf[dirlen++] = '/';
|
buf[dirlen++] = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 3 && !name; i++) {
|
snprintf(tmpBuf, PATH_MAX, "%slib%s.so", buf, module);
|
||||||
snprintf(tmpBuf, PATH_MAX, "%slib%s.%s", buf, module,
|
|
||||||
suffix[i]);
|
|
||||||
if (stat(tmpBuf, &stat_buf) == 0) {
|
if (stat(tmpBuf, &stat_buf) == 0) {
|
||||||
name = tmpBuf;
|
name = tmpBuf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
snprintf(tmpBuf, PATH_MAX, "%s%s_drv.%s", buf, module,
|
|
||||||
suffix[i]);
|
snprintf(tmpBuf, PATH_MAX, "%s%s_drv.so", buf, module);
|
||||||
if (stat(tmpBuf, &stat_buf) == 0) {
|
if (stat(tmpBuf, &stat_buf) == 0) {
|
||||||
name = tmpBuf;
|
name = tmpBuf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
snprintf(tmpBuf, PATH_MAX, "%s%s.%s", buf, module,
|
|
||||||
suffix[i]);
|
snprintf(tmpBuf, PATH_MAX, "%s%s.so", buf, module);
|
||||||
if (stat(tmpBuf, &stat_buf) == 0) {
|
if (stat(tmpBuf, &stat_buf) == 0) {
|
||||||
name = tmpBuf;
|
name = tmpBuf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (name)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
FreeSubdirs(subdirs);
|
FreeSubdirs(subdirs);
|
||||||
if (dirpath != dir)
|
if (dirpath != dir)
|
||||||
|
|
Loading…
Reference in New Issue