mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Make exec() fwork on Unix again
This commit is contained in:
parent
16c363182d
commit
8fd20c3ec7
1 changed files with 8 additions and 0 deletions
|
@ -86,7 +86,11 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
|
||||||
tmp = php_escape_shell_cmd(d);
|
tmp = php_escape_shell_cmd(d);
|
||||||
efree(d);
|
efree(d);
|
||||||
d = tmp;
|
d = tmp;
|
||||||
|
#ifdef PHP_WIN32
|
||||||
fp = V_POPEN(d, "rb");
|
fp = V_POPEN(d, "rb");
|
||||||
|
#else
|
||||||
|
fp = V_POPEN(d, "r");
|
||||||
|
#endif
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
php_error(E_WARNING, "Unable to fork [%s]", d);
|
php_error(E_WARNING, "Unable to fork [%s]", d);
|
||||||
efree(d);
|
efree(d);
|
||||||
|
@ -94,7 +98,11 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else { /* not safe_mode */
|
} else { /* not safe_mode */
|
||||||
|
#ifdef PHP_WIN32
|
||||||
fp = V_POPEN(cmd, "rb");
|
fp = V_POPEN(cmd, "rb");
|
||||||
|
#else
|
||||||
|
fp = V_POPEN(cmd, "r");
|
||||||
|
#endif
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
php_error(E_WARNING, "Unable to fork [%s]", cmd);
|
php_error(E_WARNING, "Unable to fork [%s]", cmd);
|
||||||
efree(buf);
|
efree(buf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue