[asterisk-commits] qwell: trunk r87202 - in /trunk: channels/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 26 16:37:03 CDT 2007


Author: qwell
Date: Fri Oct 26 16:37:02 2007
New Revision: 87202

URL: http://svn.digium.com/view/asterisk?view=rev&rev=87202
Log:
Correctly use defined return values in (some) load_module functions.

(issue #11096)
Patches:
      chan_agent.c.patch uploaded by eliel (license 64)
      chan_local.c.patch uploaded by eliel (license 64)
      chan_features.c.patch uploaded by eliel (license 64)
      chan_zap.c.patch uploaded by eliel (license 64)
      res_monitor.c.patch uploaded by eliel (license 64)
      res_realtime.c.patch uploaded by eliel (license 64)
      res_crypto.c.patch uploaded by eliel (license 64)

Modified:
    trunk/channels/chan_agent.c
    trunk/channels/chan_features.c
    trunk/channels/chan_local.c
    trunk/channels/chan_zap.c
    trunk/res/res_crypto.c
    trunk/res/res_monitor.c
    trunk/res/res_realtime.c

Modified: trunk/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_agent.c?view=diff&rev=87202&r1=87201&r2=87202
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Fri Oct 26 16:37:02 2007
@@ -2339,7 +2339,7 @@
 	/* Make sure we can register our agent channel type */
 	if (ast_channel_register(&agent_tech)) {
 		ast_log(LOG_ERROR, "Unable to register channel class 'Agent'\n");
-		return -1;
+		return AST_MODULE_LOAD_FAILURE;
 	}
 	/* Read in the config */
 	if (!read_agent_config(0))
@@ -2360,7 +2360,7 @@
 	/* Dialplan Functions */
 	ast_custom_function_register(&agent_function);
 
-	return 0;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int reload(void)

Modified: trunk/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_features.c?view=diff&rev=87202&r1=87201&r2=87202
==============================================================================
--- trunk/channels/chan_features.c (original)
+++ trunk/channels/chan_features.c Fri Oct 26 16:37:02 2007
@@ -551,10 +551,10 @@
 	/* Make sure we can register our sip channel type */
 	if (ast_channel_register(&features_tech)) {
 		ast_log(LOG_ERROR, "Unable to register channel class 'Feature'\n");
-		return -1;
+		return AST_MODULE_LOAD_FAILURE;
 	}
 	ast_cli_register_multiple(cli_features, sizeof(cli_features) / sizeof(struct ast_cli_entry));
-	return 0;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int unload_module(void)

Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?view=diff&rev=87202&r1=87201&r2=87202
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Fri Oct 26 16:37:02 2007
@@ -732,10 +732,10 @@
 	/* Make sure we can register our channel type */
 	if (ast_channel_register(&local_tech)) {
 		ast_log(LOG_ERROR, "Unable to register channel class 'Local'\n");
-		return -1;
+		return AST_MODULE_LOAD_FAILURE;
 	}
 	ast_cli_register_multiple(cli_local, sizeof(cli_local) / sizeof(struct ast_cli_entry));
-	return 0;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 /*! \brief Unload the local proxy channel from Asterisk */

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=87202&r1=87201&r2=87202
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Fri Oct 26 16:37:02 2007
@@ -13070,7 +13070,7 @@
 	if (ast_channel_register(&zap_tech)) {
 		ast_log(LOG_ERROR, "Unable to register channel class 'Zap'\n");
 		__unload_module();
-		return -1;
+		return AST_MODULE_LOAD_FAILURE;
 	}
 #ifdef HAVE_PRI
 	ast_string_field_init(&inuse, 16);

Modified: trunk/res/res_crypto.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_crypto.c?view=diff&rev=87202&r1=87201&r2=87202
==============================================================================
--- trunk/res/res_crypto.c (original)
+++ trunk/res/res_crypto.c Fri Oct 26 16:37:02 2007
@@ -617,7 +617,7 @@
 		crypto_load(STDIN_FILENO, STDOUT_FILENO);
 	else
 		crypto_load(-1, -1);
-	return 0;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int unload_module(void)

Modified: trunk/res/res_monitor.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_monitor.c?view=diff&rev=87202&r1=87201&r2=87202
==============================================================================
--- trunk/res/res_monitor.c (original)
+++ trunk/res/res_monitor.c Fri Oct 26 16:37:02 2007
@@ -722,7 +722,7 @@
 	ast_manager_register2("PauseMonitor", EVENT_FLAG_CALL, pause_monitor_action, pausemonitor_synopsis, pause_monitor_action_help);
 	ast_manager_register2("UnpauseMonitor", EVENT_FLAG_CALL, unpause_monitor_action, unpausemonitor_synopsis, unpause_monitor_action_help);
 
-	return 0;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int unload_module(void)

Modified: trunk/res/res_realtime.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_realtime.c?view=diff&rev=87202&r1=87201&r2=87202
==============================================================================
--- trunk/res/res_realtime.c (original)
+++ trunk/res/res_realtime.c Fri Oct 26 16:37:02 2007
@@ -130,7 +130,7 @@
 static int load_module(void)
 {
 	ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
-	return 0;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Realtime Data Lookup/Rewrite");




More information about the asterisk-commits mailing list