diff options
author | Antony Dovgal <tony2001@php.net> | 2005-01-28 01:39:35 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-01-28 01:39:35 +0000 |
commit | 418c15ef14fbf6ebe01b1db5e8078972f2bc8c91 (patch) | |
tree | 38efc14142749f58f5b87471e58be6b672016ad8 | |
parent | 37ebffee0cb1a16c23801911c71a3e78225a333c (diff) | |
download | php-git-418c15ef14fbf6ebe01b1db5e8078972f2bc8c91.tar.gz |
MFH: change return type from NULL to FALSE when parameter parsing failed
-rw-r--r-- | ext/posix/posix.c | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/ext/posix/posix.c b/ext/posix/posix.c index a7d2fd9638..ce5aeb6b28 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -180,7 +180,7 @@ ZEND_GET_MODULE(posix) #define PHP_POSIX_SINGLE_ARG_FUNC(func_name) \ long val; \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) return; \ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) RETURN_FALSE; \ if (func_name(val) < 0) { \ POSIX_G(last_error) = errno; \ RETURN_FALSE; \ @@ -194,8 +194,9 @@ PHP_FUNCTION(posix_kill) { long pid, sig; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) { + RETURN_FALSE; + } if (kill(pid, sig) < 0) { POSIX_G(last_error) = errno; @@ -354,8 +355,9 @@ PHP_FUNCTION(posix_setpgid) { long pid, pgid; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE) { + RETURN_FALSE; + } if (setpgid(pid, pgid) < 0) { POSIX_G(last_error) = errno; @@ -373,7 +375,7 @@ PHP_FUNCTION(posix_getpgid) { long val; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) { - return; + RETURN_FALSE; } if ((val = getpgid(val)) < 0) { @@ -392,7 +394,7 @@ PHP_FUNCTION(posix_getsid) { long val; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) { - return; + RETURN_FALSE; } if ((val = getsid(val)) < 0) { @@ -513,8 +515,9 @@ PHP_FUNCTION(posix_ttyname) char *p; int fd; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) { + RETURN_FALSE; + } switch (Z_TYPE_P(z_fd)) { case IS_RESOURCE: @@ -543,8 +546,9 @@ PHP_FUNCTION(posix_isatty) zval *z_fd; int fd; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) { + RETURN_FALSE; + } switch (Z_TYPE_P(z_fd)) { case IS_RESOURCE: @@ -609,8 +613,9 @@ PHP_FUNCTION(posix_mkfifo) long mode; int result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE) { + RETURN_FALSE; + } if (PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR))) { RETURN_FALSE; @@ -674,8 +679,9 @@ PHP_FUNCTION(posix_getgrnam) struct group *g; int name_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + RETURN_FALSE; + } if (NULL == (g = getgrnam(name))) { POSIX_G(last_error) = errno; @@ -698,8 +704,9 @@ PHP_FUNCTION(posix_getgrgid) long gid; struct group *g; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) { + RETURN_FALSE; + } if (NULL == (g = getgrgid(gid))) { POSIX_G(last_error) = errno; @@ -739,9 +746,9 @@ PHP_FUNCTION(posix_getpwnam) char *name; int name_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) - return; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + RETURN_FALSE; + } if (NULL == (pw = getpwnam(name))) { POSIX_G(last_error) = errno; RETURN_FALSE; @@ -764,8 +771,9 @@ PHP_FUNCTION(posix_getpwuid) long uid; struct passwd *pw; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) { + RETURN_FALSE; + } if (NULL == (pw = getpwuid(uid))) { POSIX_G(last_error) = errno; @@ -913,8 +921,9 @@ PHP_FUNCTION(posix_strerror) { long error; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) { + RETURN_FALSE; + } RETURN_STRING(strerror(error), 1); } |