diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-15 19:50:11 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-15 19:50:11 +0000 |
commit | 9a47ce9b2ce37891d5b6c55b155700b47c2ecfdb (patch) | |
tree | 45b4a40ee7848ab47bac354de1c204c423b16fc8 /main/loader.c | |
parent | 9558df93a8adf29e8ab79e0dfbd6086bc77ff218 (diff) |
In the case that you try to directly reload a module has returned
AST_MODULE_LOAD_DECLINE, log a message indicating that the module is not fully
initialized and must be initialized using "module load".
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103728 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/loader.c')
-rw-r--r-- | main/loader.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/main/loader.c b/main/loader.c index 9b96c5bf6..1b808993e 100644 --- a/main/loader.c +++ b/main/loader.c @@ -578,8 +578,16 @@ int ast_module_reload(const char *name) if (name && resource_name_match(name, cur->resource)) continue; - if (!cur->flags.running || cur->flags.declined) - continue; + if (!cur->flags.running || cur->flags.declined) { + if (!name) + continue; + ast_log(LOG_NOTICE, "The module '%s' was not properly initialized. " + "Before reloading the module, you must run \"module load %s\" " + "and fix whatever is preventing the module from being initialized.\n", + name, name); + res = 2; /* Don't report that the module was not found */ + break; + } if (!info->reload) { /* cannot be reloaded */ if (res < 1) /* store result if possible */ |