]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Make custom directory for mod_xml_cdr if missing
authorTravis Cross <tc@traviscross.com>
Sun, 10 Feb 2013 04:27:00 +0000 (04:27 +0000)
committerTravis Cross <tc@traviscross.com>
Sun, 10 Feb 2013 04:32:52 +0000 (04:32 +0000)
Previously mod_xml_cdr would only make its directory if log-dir was
not specified.  The behavior now matches that of mod_json_cdr.

src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c

index 8779caa6f3c24d989cb4ec3c466cd8d124b78f12..a71935a0d7eefe5ba187fdf863211bd7d8f6f1a3 100644 (file)
@@ -127,6 +127,7 @@ static switch_status_t set_xml_cdr_log_dirs()
                        if ((path = switch_safe_strdup(globals.base_log_dir))) {
                                switch_thread_rwlock_wrlock(globals.log_path_lock);
                                switch_safe_free(globals.log_dir);
+                               switch_dir_make_recursive(path, SWITCH_DEFAULT_DIR_PERMS, globals.pool);
                                globals.log_dir = path;
                                switch_thread_rwlock_unlock(globals.log_path_lock);
                        } else {
@@ -165,6 +166,7 @@ static switch_status_t set_xml_cdr_log_dirs()
                        if ((path = switch_safe_strdup(globals.base_err_log_dir))) {
                                switch_thread_rwlock_wrlock(globals.log_path_lock);
                                switch_safe_free(globals.err_log_dir);
+                               switch_dir_make_recursive(path, SWITCH_DEFAULT_DIR_PERMS, globals.pool);
                                globals.err_log_dir = path;
                                switch_thread_rwlock_unlock(globals.log_path_lock);
                        } else {