summaryrefslogtreecommitdiff
path: root/ext/standard/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r--ext/standard/exec.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index ca6942a9c9..bd65d60656 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -57,7 +57,7 @@
* If type==3, output will be printed binary, no lines will be saved or returned (passthru)
*
*/
-PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC)
+PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
{
FILE *fp;
char *buf;
@@ -80,7 +80,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_
fp = VCWD_POPEN(cmd, "r");
#endif
if (!fp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", cmd);
+ php_error_docref(NULL, E_WARNING, "Unable to fork [%s]", cmd);
goto err;
}
@@ -110,8 +110,8 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_
if (type == 1) {
PHPWRITE(buf, bufl);
- if (php_output_get_level(TSRMLS_C) < 1) {
- sapi_flush(TSRMLS_C);
+ if (php_output_get_level() < 1) {
+ sapi_flush();
}
} else if (type == 2) {
/* strip trailing whitespaces */
@@ -177,27 +177,27 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
int ret;
if (mode) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
RETURN_FALSE;
}
}
if (!cmd_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute a blank command");
+ php_error_docref(NULL, E_WARNING, "Cannot execute a blank command");
RETURN_FALSE;
}
if (!ret_array) {
- ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC);
+ ret = php_exec(mode, cmd, NULL, return_value);
} else {
if (Z_TYPE_P(ret_array) != IS_ARRAY) {
zval_dtor(ret_array);
array_init(ret_array);
}
- ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC);
+ ret = php_exec(2, cmd, ret_array, return_value);
}
if (ret_code) {
zval_dtor(ret_code);
@@ -248,7 +248,6 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
char *p = NULL;
#endif
- TSRMLS_FETCH();
cmd = zend_string_alloc(2 * l, 0);
@@ -340,7 +339,6 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
zend_string *cmd;
size_t estimate = (4 * l) + 3;
- TSRMLS_FETCH();
cmd = zend_string_alloc(4 * l + 2, 0); /* worst case */
@@ -404,7 +402,7 @@ PHP_FUNCTION(escapeshellcmd)
char *command;
size_t command_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) {
return;
}
@@ -423,7 +421,7 @@ PHP_FUNCTION(escapeshellarg)
char *argument;
size_t argument_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &argument, &argument_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &argument, &argument_len) == FAILURE) {
return;
}
@@ -443,7 +441,7 @@ PHP_FUNCTION(shell_exec)
zend_string *ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) {
return;
}
@@ -452,7 +450,7 @@ PHP_FUNCTION(shell_exec)
#else
if ((in=VCWD_POPEN(command, "r"))==NULL) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute '%s'", command);
+ php_error_docref(NULL, E_WARNING, "Unable to execute '%s'", command);
RETURN_FALSE;
}
@@ -473,14 +471,14 @@ PHP_FUNCTION(proc_nice)
{
zend_long pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pri) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pri) == FAILURE) {
RETURN_FALSE;
}
errno = 0;
php_ignore_value(nice(pri));
if (errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only a super user may attempt to increase the priority of a process");
+ php_error_docref(NULL, E_WARNING, "Only a super user may attempt to increase the priority of a process");
RETURN_FALSE;
}