diff options
author | Stanislav Malyshev <stas@php.net> | 2000-06-26 17:12:38 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2000-06-26 17:12:38 +0000 |
commit | 8fd20c3ec7e7d5213f9c810c68db4ecccaa24c6c (patch) | |
tree | 34eb81d1ec8f8b117d1d67dfe91007888d12150d /ext/standard/exec.c | |
parent | 16c363182d9f82ad5fab7b6da3d8d190538d40ef (diff) | |
download | php-git-8fd20c3ec7e7d5213f9c810c68db4ecccaa24c6c.tar.gz |
Make exec() fwork on Unix again
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r-- | ext/standard/exec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 61bc6f21ce..7fc6acc033 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -86,7 +86,11 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value) tmp = php_escape_shell_cmd(d); efree(d); d = tmp; +#ifdef PHP_WIN32 fp = V_POPEN(d, "rb"); +#else + fp = V_POPEN(d, "r"); +#endif if (!fp) { php_error(E_WARNING, "Unable to fork [%s]", d); efree(d); @@ -94,7 +98,11 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value) return -1; } } else { /* not safe_mode */ +#ifdef PHP_WIN32 fp = V_POPEN(cmd, "rb"); +#else + fp = V_POPEN(cmd, "r"); +#endif if (!fp) { php_error(E_WARNING, "Unable to fork [%s]", cmd); efree(buf); |