Permalink
Browse files

Use sys_getloadavg() instead of reading /proc/loadavg. Fixes #1491.

  • Loading branch information...
1 parent 8d030ce commit c1573d8ef2e34429a67a69c3ad947505a5772931 @bharat bharat committed Nov 18, 2010
Showing with 1 addition and 6 deletions.
  1. +1 −6 modules/gallery/helpers/gallery_block.php
@@ -70,12 +70,7 @@ static function get($block_id) {
$block->css_id = "g-platform";
$block->title = t("Platform information");
$block->content = new View("admin_block_platform.html");
- if (@is_readable("/proc/loadavg") && $first_line = current(@file("/proc/loadavg"))) {
- $block->content->load_average =
- join(" ", array_slice(explode(" ", $first_line), 0, 3));
- } else {
- $block->content->load_average = t("Unavailable");
- }
+ $block->content->load_average = join(" ", sys_getloadavg());
break;
case "project_news":

0 comments on commit c1573d8

Please sign in to comment.