]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Correctly use defined return values in (some) load_module functions.
authorJason Parker <jparker@digium.com>
Fri, 26 Oct 2007 21:37:02 +0000 (21:37 +0000)
committerJason Parker <jparker@digium.com>
Fri, 26 Oct 2007 21:37:02 +0000 (21:37 +0000)
(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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87202 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

index 8f103ae371566027242cb7fa33a889d40717786f..cf1794ac874df1a5bcc634e4114db0c781bf0bb0 100644 (file)
@@ -2339,7 +2339,7 @@ static int load_module(void)
        /* 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 @@ static int load_module(void)
        /* Dialplan Functions */
        ast_custom_function_register(&agent_function);
 
-       return 0;
+       return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int reload(void)
index 4ef9d4125c5405018b4a6ff220227f15875249d7..27722d37291ace23f81a738d4d5b9b6531b9cab4 100644 (file)
@@ -551,10 +551,10 @@ static int load_module(void)
        /* 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)
index 3aa46cf6e5f39efe77ad1a9777130ac25e38cad2..e79057ee41b13e65c56572562e83d7f1108af286 100644 (file)
@@ -732,10 +732,10 @@ static int load_module(void)
        /* 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 */
index f38d8624735aac50b3000ff56a17525e5e8c1c99..9428a43594cd6a91a18a5e73259314920fc827b6 100644 (file)
@@ -13070,7 +13070,7 @@ static int load_module(void)
        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);
index 9ef65d65280ced7f9ff5cc749c3ba44adc51587f..17b7789c3575bd90b240c982e26f788e4a52f11f 100644 (file)
@@ -617,7 +617,7 @@ static int load_module(void)
                crypto_load(STDIN_FILENO, STDOUT_FILENO);
        else
                crypto_load(-1, -1);
-       return 0;
+       return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int unload_module(void)
index e34b89a4045cc3f9fbbba1205d9474750786d21a..048bcf15612c3ad1aeb1e8d104a47c7c8f278ae2 100644 (file)
@@ -722,7 +722,7 @@ static int load_module(void)
        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)
index 8f96c8f54b69c817ee2d6116fa68684837b095c9..49f49c5eb60bf6de7f19c69bf75053d9ac713dab 100644 (file)
@@ -130,7 +130,7 @@ static int unload_module(void)
 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");