mirror of
https://github.com/php/php-src.git
synced 2025-01-07 11:34:09 +08:00
getrusage.c was easy(). But don't ever use zend_parse_parameters() like
that.
This commit is contained in:
parent
9c83ae0549
commit
dbda777b0b
@ -107,7 +107,7 @@ PHP_FUNCTION(gettimeofday)
|
||||
/* }}} */
|
||||
|
||||
#ifdef HAVE_GETRUSAGE
|
||||
/* {{{ proto array getrusage([int who])
|
||||
/* {{{ proto array getrusage([int who]) U
|
||||
Returns an array of usage statistics */
|
||||
PHP_FUNCTION(getrusage)
|
||||
{
|
||||
@ -115,7 +115,11 @@ PHP_FUNCTION(getrusage)
|
||||
long pwho = 0;
|
||||
int who = RUSAGE_SELF;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) != FAILURE && pwho == 1) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pwho == 1) {
|
||||
who = RUSAGE_CHILDREN;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user