diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-20 19:12:52 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-20 19:12:52 +0000 |
commit | feb6455c27b594d3da0dd96fe5c519a49c04c337 (patch) | |
tree | af59f272fdab5c0ecb7b1dc1e2b348ff25f3d2bb /main/loader.c | |
parent | e4f591091a1c38d9c4eb6e272d21e7c37e7221aa (diff) |
bring back compile-option checking when loading modules, only this time use a string-based storage and comparison mechanism because it is easier to support on other platforms
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89461 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/loader.c')
-rw-r--r-- | main/loader.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/loader.c b/main/loader.c index 7df486251..6522f01bf 100644 --- a/main/loader.c +++ b/main/loader.c @@ -76,6 +76,8 @@ static unsigned char expected_key[] = { 0x87, 0x76, 0x79, 0x35, 0x23, 0xea, 0x3a, 0xd3, 0x25, 0x2a, 0xbb, 0x35, 0x87, 0xe4, 0x22, 0x24 }; +static char buildopt_sum[33] = AST_BUILDOPT_SUM; + static unsigned int embedding = 1; /* we always start out by registering embedded modules, since they are here before we dlopen() any */ @@ -613,6 +615,13 @@ static unsigned int inspect_module(const struct ast_module *mod) return 1; } + if (!ast_strlen_zero(mod->info->buildopt_sum) && + strcmp(buildopt_sum, mod->info->buildopt_sum)) { + ast_log(LOG_WARNING, "Module '%s' was not compiled with the same compile-time options as this version of Asterisk.\n", mod->resource); + ast_log(LOG_WARNING, "Module '%s' will not be initialized as it may cause instability.\n", mod->resource); + return 1; + } + return 0; } |