[asterisk-commits] russell: trunk r202258 - /trunk/cdr/cdr_manager.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jun 21 11:00:34 CDT 2009
Author: russell
Date: Sun Jun 21 11:00:23 2009
New Revision: 202258
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202258
Log:
Standardize return values of load_config() so reload() doesn't report an error on success.
Modified:
trunk/cdr/cdr_manager.c
Modified: trunk/cdr/cdr_manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/cdr/cdr_manager.c?view=diff&rev=202258&r1=202257&r2=202258
==============================================================================
--- trunk/cdr/cdr_manager.c (original)
+++ trunk/cdr/cdr_manager.c Sun Jun 21 11:00:23 2009
@@ -64,12 +64,13 @@
int newenablecdr = 0;
cfg = ast_config_load(CONF_FILE, config_flags);
- if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
return 0;
+ }
if (cfg == CONFIG_STATUS_FILEINVALID) {
ast_log(LOG_ERROR, "Config file '%s' could not be parsed\n", CONF_FILE);
- return 1;
+ return -1;
}
if (reload && customfields) {
@@ -83,7 +84,7 @@
if (enablecdr)
ast_cdr_unregister(name);
enablecdr = 0;
- return 0;
+ return -1;
}
while ( (cat = ast_category_browse(cfg, cat)) ) {
@@ -122,7 +123,7 @@
ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
enablecdr = newenablecdr;
- return 1;
+ return 0;
}
static int manager_log(struct ast_cdr *cdr)
@@ -199,9 +200,9 @@
static int load_module(void)
{
- /* Configuration file */
- if (!load_config(0))
+ if (load_config(0)) {
return AST_MODULE_LOAD_DECLINE;
+ }
return AST_MODULE_LOAD_SUCCESS;
}
More information about the asterisk-commits
mailing list