From 4d522da4aad7148fc43cdc9ff94e0de65b13cc33 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Tue, 20 Nov 2007 19:28:10 +0000 Subject: switch compile-time option checking to string storage mode in this branch too git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89463 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/loader.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'main/loader.c') diff --git a/main/loader.c b/main/loader.c index 372af6eb5..5e51c8401 100644 --- a/main/loader.c +++ b/main/loader.c @@ -74,7 +74,7 @@ static unsigned char expected_key[] = { 0x87, 0x76, 0x79, 0x35, 0x23, 0xea, 0x3a, 0xd3, 0x25, 0x2a, 0xbb, 0x35, 0x87, 0xe4, 0x22, 0x24 }; -static unsigned int buildopt_sum[4] = AST_BUILDOPT_SUM; +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 @@ -603,8 +603,6 @@ int ast_module_reload(const char *name) static unsigned int inspect_module(const struct ast_module *mod) { - unsigned int buildopt_empty[4] = { 0, }; - if (!mod->info->description) { ast_log(LOG_WARNING, "Module '%s' does not provide a description.\n", mod->resource); return 1; @@ -620,8 +618,8 @@ static unsigned int inspect_module(const struct ast_module *mod) return 1; } - if (memcmp(buildopt_empty, mod->info->buildopt_sum, sizeof(buildopt_empty)) && - memcmp(buildopt_sum, mod->info->buildopt_sum, sizeof(buildopt_sum))) { + 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; -- cgit v1.2.3