cvs: php-src(PHP_5_0) /ext/posix posix.c

From: Date: Fri, 28 Jan 2005 01:39:35 +0000
Subject: cvs: php-src(PHP_5_0) /ext/posix posix.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-30189@lists.php.net to get a copy of this message
tony2001 Thu Jan 27 20:39:35 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/posix posix.c Log: MFH: change return type from NULL to FALSE when parameter parsing failed http://cvs.php.net/diff.php/php-src/ext/posix/posix.c?r1=1.60.2.1&r2=1.60.2.2&ty=u Index: php-src/ext/posix/posix.c diff -u php-src/ext/posix/posix.c:1.60.2.1 php-src/ext/posix/posix.c:1.60.2.2 --- php-src/ext/posix/posix.c:1.60.2.1 Thu Jan 27 19:26:07 2005 +++ php-src/ext/posix/posix.c Thu Jan 27 20:39:35 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: posix.c,v 1.60.2.1 2005/01/28 00:26:07 tony2001 Exp $ */ +/* $Id: posix.c,v 1.60.2.2 2005/01/28 01:39:35 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -131,7 +131,7 @@ static PHP_MINFO_FUNCTION(posix) { php_info_print_table_start(); - php_info_print_table_row(2, "Revision", "$Revision: 1.60.2.1 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.60.2.2 $"); php_info_print_table_end(); } /* }}} */ @@ -180,7 +180,7 @@ #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 @@ { 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 @@ { 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 @@ { 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 @@ { 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ { 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); }

« previous php.cvs (#30189) next »