00094: getrusage() called by mistake, issues warning

Summary: getrusage() called by mistake, issues warning
Created: 2004-10-14 06:06
Status: Closed - fixed for 2.0.devel16
Category: Bug
Assigned:
Priority: 2
Version: 2.0.devel13
OS: Windows/Apache/4.2.3

Description: In pmwiki.php, StopWatch() uses the getrusage() function, which doesn't work on Windows. It does first check to see if getrusage() exists; however, on this version of PHP, the function exists, it just returns null and outputs a warning.

Replacing the code:

  if (function_exists('getrusage')) {
    $dat = getrusage();
    $GLOBALS['StopWatch'][] = ...

With:

  if (function_exists('getrusage')) {
    $dat = @getrusage();
    if ($dat)
      $GLOBALS['StopWatch'][] = ...

Fixes the problem.


Fixed, thanks. --Pm