]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
use -base directory as the cwd for the process
authorMoises Silva <moy@sangoma.com>
Mon, 13 Jun 2011 17:33:25 +0000 (13:33 -0400)
committerMoises Silva <moy@sangoma.com>
Mon, 13 Jun 2011 17:36:17 +0000 (13:36 -0400)
src/include/switch_apr.h
src/switch.c
src/switch_apr.c

index 2306075e1f8d4b692ab6b487b1215c605078e8ad..9ec6f9449635c71ed1dd45c0af59984c1382607d 100644 (file)
@@ -854,6 +854,7 @@ SWITCH_DECLARE(switch_status_t) switch_queue_trypush(switch_queue_t *queue, void
 SWITCH_DECLARE(switch_status_t) switch_file_open(switch_file_t ** newf, const char *fname, int32_t flag, switch_fileperms_t perm,
                                                                                                 switch_memory_pool_t *pool);
 
+SWITCH_DECLARE(switch_status_t) switch_filepath_set(const char *path, switch_memory_pool_t *pool);
 
 SWITCH_DECLARE(switch_status_t) switch_file_seek(switch_file_t *thefile, switch_seek_where_t where, int64_t *offset);
 
index 7d4d1a82176a5e791d1ae25380cbac37080e8f6c..49ca107f6793d4abe2dfbaaf7d5655aad697f189 100644 (file)
@@ -875,6 +875,8 @@ int main(int argc, char *argv[])
 
        apr_pool_create(&pool, NULL);
 
+       switch_filepath_set(SWITCH_GLOBAL_dirs.base_dir, pool);
+
        switch_dir_make_recursive(SWITCH_GLOBAL_dirs.run_dir, SWITCH_DEFAULT_DIR_PERMS, pool);
 
        if (switch_file_open(&fd, pid_path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, pool) == SWITCH_STATUS_SUCCESS) {
index 495e0605a814f8a64480908451ee56b274c95af8..24c966e6dc4ca0e96933d939747f69574ae03d84 100644 (file)
@@ -403,6 +403,11 @@ SWITCH_DECLARE(switch_status_t) switch_file_open(switch_file_t ** newf, const ch
        return apr_file_open(newf, fname, flag, perm, pool);
 }
 
+SWITCH_DECLARE(switch_status_t) switch_filepath_set(const char *path, switch_memory_pool_t *pool)
+{
+       return apr_filepath_set(path, pool);
+}
+
 SWITCH_DECLARE(switch_status_t) switch_file_seek(switch_file_t *thefile, switch_seek_where_t where, int64_t *offset)
 {
        apr_status_t rv;