getrusage.c was easy(). But don't ever use zend_parse_parameters() like

that.
This commit is contained in:
Andrei Zmievski 2006-10-19 22:14:04 +00:00
parent 9c83ae0549
commit dbda777b0b

View File

@ -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;
}