diff options
| author | Zak Greant <zak@php.net> | 2001-12-30 09:50:41 +0000 |
|---|---|---|
| committer | Zak Greant <zak@php.net> | 2001-12-30 09:50:41 +0000 |
| commit | 59a45acca6b045baaaf3a3421158a8b405ae8148 (patch) | |
| tree | 6dd1bd32076abfb9a9dfd81388f8cfe0e3cb2c35 | |
| parent | 2f6ffb545e625f98ba0102212d968dbf2871277c (diff) | |
| download | php-git-59a45acca6b045baaaf3a3421158a8b405ae8148.tar.gz | |
chroot: corrected prototype, converted to zend_parse_parameters
| -rw-r--r-- | ext/standard/dir.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 42a027041f..9d268972ee 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -222,20 +222,18 @@ PHP_FUNCTION(closedir) /* }}} */ #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC -/* {{{ proto int chroot(string directory) +/* {{{ proto bool chroot(string directory) Change root directory */ PHP_FUNCTION(chroot) { - pval **arg; - int ret; + char *str; + int ret, str_len; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + RETURN_FALSE; } - convert_to_string_ex(arg); - - ret = chroot(Z_STRVAL_PP(arg)); + ret = chroot(str); if (ret != 0) { php_error(E_WARNING, "chroot: %s (errno %d)", strerror(errno), errno); |
