diff options
author | Shane Caraveo <shane@php.net> | 2002-10-29 07:32:52 +0000 |
---|---|---|
committer | Shane Caraveo <shane@php.net> | 2002-10-29 07:32:52 +0000 |
commit | 1f0523c85acfeddf2b5edbf33d7eacb0dc0fc3de (patch) | |
tree | dd4afa8808a82fc416c31e17d895faf30724c13c /TSRM/tsrm_virtual_cwd.c | |
parent | a33bd0979d56372dd7155e502b57e13009566841 (diff) | |
download | php-git-1f0523c85acfeddf2b5edbf33d7eacb0dc0fc3de.tar.gz |
windows is smart enough to provide a way to set cwd for new processes.
Diffstat (limited to 'TSRM/tsrm_virtual_cwd.c')
-rw-r--r-- | TSRM/tsrm_virtual_cwd.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index ce4f2538f2..bb5bac0c3a 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -799,33 +799,9 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) #ifdef TSRM_WIN32 -/* On Windows the trick of prepending "cd cwd; " doesn't work so we need to perform - a real chdir() and mutex it - */ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) { - char prev_cwd[MAXPATHLEN]; - char *getcwd_result; - FILE *retval; - - getcwd_result = getcwd(prev_cwd, MAXPATHLEN); - if (!getcwd_result) { - return NULL; - } - -#ifdef ZTS - tsrm_mutex_lock(cwd_mutex); -#endif - - chdir(CWDG(cwd).cwd); - retval = popen(command, type); - chdir(prev_cwd); - -#ifdef ZTS - tsrm_mutex_unlock(cwd_mutex); -#endif - - return retval; + return popen_ex(command, type, CWDG(cwd).cwd, NULL); } #elif defined(NETWARE) |