return -1;
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
ast_debug(1, "%s: Config file unchanged, not reloading\n", config_filename);
- return 0;
+ return 1;
}
while ((category = ast_category_browse_filtered(cfg, NULL, category, NULL))) {
return -1;
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
ast_debug(1, "%s: Config file unchanged, not reloading\n", config_filename);
- return 0;
+ return 1;
}
while ((category = ast_category_browse_filtered(cfg, NULL, category, NULL))) {
}
res = load_config_file(output_type, record_type, new_configs, filename, 1);
- if (res != 0) {
+ if (res < 0) {
AST_VECTOR_RESET(new_configs, config_free);
AST_VECTOR_PTR_FREE(new_configs);
return AST_MODULE_LOAD_DECLINE;
}
- /* Now swap the new ones in. */
- *configs = new_configs;
+ if (res == 0) {
+ /* Now swap the new ones in. */
+ *configs = new_configs;
- /* Free the old ones. */
- AST_VECTOR_RESET(old_configs, config_free);
- AST_VECTOR_PTR_FREE(old_configs);
+ /* Free the old ones. */
+ AST_VECTOR_RESET(old_configs, config_free);
+ AST_VECTOR_PTR_FREE(old_configs);
+ }
return AST_MODULE_LOAD_SUCCESS;
-
-
- return -1;
}
struct cdrel_configs *cdrel_load_module(enum cdrel_backend_type backend_type,