Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Запуск на freebsd #24

Merged
merged 2 commits into from Oct 12, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Realplexor/Tools.pm
Expand Up @@ -41,7 +41,7 @@ sub rerun_unlimited {
# Returns amount of used memory by pid (in megabytes). # Returns amount of used memory by pid (in megabytes).
sub get_memory_usage { sub get_memory_usage {
my ($pid) = @_; 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`; my $mem = `ps -p $pid -o rss $h`;
return 0 if !$mem; return 0 if !$mem;
$mem =~ s/\s+//sg; $mem =~ s/\s+//sg;
Expand Down