From c93520b88b37c124481c7f641f0ce892249e561f Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Fri, 2 Nov 2007 21:39:36 +0000
Subject: [PATCH] propagate the DECLINE return value back to the loader

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 pbx/pbx_lua.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c
index 49d0ae51db..193f031a57 100644
--- a/pbx/pbx_lua.c
+++ b/pbx/pbx_lua.c
@@ -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;
-- 
GitLab