From 51377db4a5aee233d3f51740fe6477a77142c21d Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Wed, 14 Nov 2007 02:57:13 +0000
Subject: [PATCH] - Use the ARRAY_LEN macro in a couple places - return errors
 from load_module / unload_module

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 res/res_clioriginate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/res/res_clioriginate.c b/res/res_clioriginate.c
index 09cde4d7cc..5f2b6ab03d 100644
--- a/res/res_clioriginate.c
+++ b/res/res_clioriginate.c
@@ -182,15 +182,15 @@ static struct ast_cli_entry cli_cliorig[] = {
 /*! \brief Unload orginate module */
 static int unload_module(void)
 {
-	ast_cli_unregister_multiple(cli_cliorig, sizeof(cli_cliorig) / sizeof(struct ast_cli_entry));
-	return 0;
+	return ast_cli_unregister_multiple(cli_cliorig, ARRAY_LEN(cli_cliorig));
 }
 
 /*! \brief Load orginate module */
 static int load_module(void)
 {
-	ast_cli_register_multiple(cli_cliorig, sizeof(cli_cliorig) / sizeof(struct ast_cli_entry));
-	return AST_MODULE_LOAD_SUCCESS;
+	int res;
+	res = ast_cli_register_multiple(cli_cliorig, ARRAY_LEN(cli_cliorig));
+	return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call origination from the CLI");
-- 
GitLab