Browse files

Merge pull request #24 from DavidKlassen/master

FreeBSD compatibility.
  • Loading branch information...
2 parents 33d7433 + d8a88aa commit 0b59237d8cb15482b2e38c0bfe08608d390cf6b7 @DmitryKoterov committed Oct 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Realplexor/Tools.pm
View
2 Realplexor/Tools.pm
@@ -41,7 +41,7 @@ sub rerun_unlimited {
# Returns amount of used memory by pid (in megabytes).
sub get_memory_usage {
my ($pid) = @_;
- my $h = "$^O" eq "darwin" ? " | awk 'NR>1'" : "--no-headers";
+ my $h = "$^O" =~ /^(freebsd|darwin)$/ ? " | awk 'NR>1'" : "--no-headers";
my $mem = `ps -p $pid -o rss $h`;
return 0 if !$mem;
$mem =~ s/\s+//sg;

0 comments on commit 0b59237

Please sign in to comment.