use -base directory as the cwd for the process

This commit is contained in:
Moises Silva 2011-06-13 13:33:25 -04:00
parent bced67d4f5
commit d19d4b96ab
3 changed files with 8 additions and 0 deletions

View 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);

View 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) {

View 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;