<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7829">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">General: Silence modules on (un)load.<br><br>Some (normally optional) modules created notices, warnings, and even errors<br>in normal situations like (un)load. This cluttered the command-line interface<br>(CLI) on start and while stopping gracefully. However, when an user went for<br>the script './contrib/scripts/install_prereq', those modules get compiled-in<br>because their prerequisites were met at compile time. Furthermore, because of<br>ASTERISK-27475, the former talkative module 'res_curl' is built as side-effect.<br><br>ASTERISK-27553<br><br>Change-Id: I9f105f46d72553994e820679bfde3478a551b281<br>---<br>M pbx/pbx_lua.c<br>M res/res_curl.c<br>M res/res_odbc.c<br>3 files changed, 3 insertions(+), 29 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/29/7829/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c<br>index fcab476..741e950 100644<br>--- a/pbx/pbx_lua.c<br>+++ b/pbx/pbx_lua.c<br>@@ -1648,9 +1648,6 @@<br>                 }<br>     }<br> <br>- if (!res) {<br>-          ast_log(LOG_NOTICE, "Lua PBX Switch loaded.\n");<br>-   }<br>     lua_close(L);<br>         return res;<br> }<br>@@ -1660,7 +1657,6 @@<br>        ast_context_destroy(NULL, registrar);<br>         ast_unregister_switch(&lua_switch);<br>       lua_free_extensions();<br>-       ast_log(LOG_NOTICE, "Lua PBX Switch unloaded.\n");<br>  return 0;<br> }<br> <br>diff --git a/res/res_curl.c b/res/res_curl.c<br>index 2551efc..0ffebc2 100644<br>--- a/res/res_curl.c<br>+++ b/res/res_curl.c<br>@@ -60,7 +60,6 @@<br>  /* If the dependent modules are still in memory, forbid unload */<br>     for (i = 0; i < ARRAY_LEN(dependents); i++) {<br>              if (ast_module_check(dependents[i])) {<br>-                       ast_log(LOG_ERROR, "%s (dependent module) is still loaded.  Cannot unload res_curl.so\n", dependents[i]);<br>                   res = -1;<br>             }<br>     }<br>@@ -73,19 +72,9 @@<br>         return res;<br> }<br> <br>-/*!<br>- * \brief Load the module<br>- *<br>- * Module loading including tests for configuration or dependencies.<br>- * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,<br>- * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails<br>- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the<br>- * configuration file or other non-critical problem return<br>- * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.<br>- */<br> static int load_module(void)<br> {<br>-     int res = 0;<br>+ int res = AST_MODULE_LOAD_SUCCESS;<br> <br>         if (curl_global_init(CURL_GLOBAL_ALL)) {<br>              ast_log(LOG_ERROR, "Unable to initialize the cURL library. Cannot load res_curl.so\n");<br>diff --git a/res/res_odbc.c b/res/res_odbc.c<br>index 7aa4524..c5979ee 100644<br>--- a/res/res_odbc.c<br>+++ b/res/res_odbc.c<br>@@ -992,7 +992,7 @@<br>       }<br>     AST_RWLIST_UNLOCK(&odbc_tables);<br> <br>-      return 0;<br>+    return AST_MODULE_RELOAD_SUCCESS;<br> }<br> <br> static int unload_module(void)<br>@@ -1001,16 +1001,6 @@<br>     return -1;<br> }<br> <br>-/*!<br>- * \brief Load the module<br>- *<br>- * Module loading including tests for configuration or dependencies.<br>- * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,<br>- * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails<br>- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the<br>- * configuration file or other non-critical problem return<br>- * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.<br>- */<br> static int load_module(void)<br> {<br>       if (!(class_container = ao2_container_alloc(1, null_hash_fn, ao2_match_by_addr)))<br>@@ -1018,8 +1008,7 @@<br>      if (load_odbc_config() == -1)<br>                 return AST_MODULE_LOAD_DECLINE;<br>       ast_cli_register_multiple(cli_odbc, ARRAY_LEN(cli_odbc));<br>-    ast_log(LOG_NOTICE, "res_odbc loaded.\n");<br>- return 0;<br>+    return AST_MODULE_LOAD_SUCCESS;<br> }<br> <br> AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "ODBC resource",<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7829">change 7829</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7829"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I9f105f46d72553994e820679bfde3478a551b281 </div>
<div style="display:none"> Gerrit-Change-Number: 7829 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>