From: Andrei Zmievski Date: Thu, 19 Oct 2006 22:14:04 +0000 (+0000) Subject: getrusage.c was easy(). But don't ever use zend_parse_parameters() like X-Git-Tag: RELEASE_1_0_0RC1~1238 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dbda777b0be6bc6ec26b8195dfb68cefae224d25;p=php getrusage.c was easy(). But don't ever use zend_parse_parameters() like that. --- diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index 449ecc133a..6f58000f4b 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -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; }