propagate the DECLINE return value back to the loader
authorRussell Bryant <russell@russellbryant.com>
Fri, 2 Nov 2007 21:39:36 +0000 (21:39 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 2 Nov 2007 21:39:36 +0000 (21:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88376 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx/pbx_lua.c

index 49d0ae5..193f031 100644 (file)
@@ -1304,12 +1304,14 @@ static int reload(void)
 
 static int load_module(void)
 {
-       if (load_or_reload_lua_stuff())
-               return AST_MODULE_LOAD_FAILURE;
+       int res;
+
+       if ((res = load_or_reload_lua_stuff()))
+               return res;
 
        if (ast_register_switch(&lua_switch)) {
                ast_log(LOG_ERROR, "Unable to register LUA PBX switch\n");
-               return AST_MODULE_LOAD_FAILURE;
+               return AST_MODULE_LOAD_DECLINE;
        }
 
        return AST_MODULE_LOAD_SUCCESS;