diff options
author | Timo Sirainen <cras@irssi.org> | 2001-10-24 22:24:14 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-10-24 22:24:14 +0000 |
commit | f7683c0423277dec3ec939cf33c3044658ee48a5 (patch) | |
tree | 7e8003b90f365ac70b40352b950c855a56836d48 /src/core/modules-load.c | |
parent | bdf5bf97859a8a3c649c9abedb884ba7907ce61d (diff) | |
download | irssi-f7683c0423277dec3ec939cf33c3044658ee48a5.zip |
Added a bit better error reporting.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1911 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/modules-load.c')
-rw-r--r-- | src/core/modules-load.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/modules-load.c b/src/core/modules-load.c index 17f50e55..04342a1b 100644 --- a/src/core/modules-load.c +++ b/src/core/modules-load.c @@ -101,7 +101,7 @@ static char *module_get_sub(const char *name, const char *root) return g_strdup(name); } -static GModule *module_open(const char *name) +static GModule *module_open(const char *name, int *found) { struct stat statbuf; GModule *module; @@ -119,6 +119,7 @@ static GModule *module_open(const char *name) if (stat(path, &statbuf) == 0) { module = g_module_open(path, (GModuleFlags) 0); g_free(path); + *found = TRUE; return module; } @@ -127,6 +128,7 @@ static GModule *module_open(const char *name) path = g_module_build_path(MODULEDIR, name); } + *found = stat(path, &statbuf) == 0; module = g_module_open(path, (GModuleFlags) 0); g_free(path); return module; @@ -161,13 +163,13 @@ static int module_load_name(const char *path, const char *rootmodule, char *initfunc, *deinitfunc; int found; - gmodule = module_open(path); + gmodule = module_open(path, &found); if (gmodule == NULL) { - if (!silent) { + if (!silent || found) { module_error(MODULE_ERROR_LOAD, g_module_error(), rootmodule, submodule); } - return -1; + return found ? 0 : -1; } /* get the module's init() and deinit() functions */ |