提交 dd6219c6 authored 作者: Anthony Minessale's avatar Anthony Minessale

try to make the dir first so if it fails the mod fails properly

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15859 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 6a89b33d
...@@ -388,9 +388,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_csv_load) ...@@ -388,9 +388,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_csv_load)
{ {
switch_status_t status = SWITCH_STATUS_SUCCESS; switch_status_t status = SWITCH_STATUS_SUCCESS;
if (switch_event_bind(modname, SWITCH_EVENT_TRAP, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL) != SWITCH_STATUS_SUCCESS) { if ((status = switch_dir_make_recursive(globals.log_dir, SWITCH_DEFAULT_DIR_PERMS, pool)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating %s\n", globals.log_dir);
return status;
}
if ((status = switch_event_bind(modname, SWITCH_EVENT_TRAP, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR; return status;
} }
switch_core_add_state_handler(&state_handlers); switch_core_add_state_handler(&state_handlers);
...@@ -398,9 +403,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_csv_load) ...@@ -398,9 +403,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_csv_load)
load_config(pool); load_config(pool);
if ((status = switch_dir_make_recursive(globals.log_dir, SWITCH_DEFAULT_DIR_PERMS, pool)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating %s\n", globals.log_dir);
}
return status; return status;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论