only call sysctl on bsd
This commit is contained in:
parent
350a2939b4
commit
e534739d04
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
package Net::Connection::lsof;
|
package Net::Connection::lsof;
|
||||||
|
|
||||||
use 5.006;
|
use 5.006;
|
||||||
|
@ -16,11 +17,11 @@ Net::Connection::lsof - This uses lsof to generate a array of Net::Connection ob
|
||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
Version 0.1.0
|
Version 0.1.1
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
our $VERSION = '0.1.0';
|
our $VERSION = '0.1.1';
|
||||||
|
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
@ -125,9 +126,11 @@ sub lsof_to_nc_objects{
|
||||||
if ( $func_args{proc_info} ){
|
if ( $func_args{proc_info} ){
|
||||||
my $pt=Proc::ProcessTable->new;
|
my $pt=Proc::ProcessTable->new;
|
||||||
$proc_table=$pt->table;
|
$proc_table=$pt->table;
|
||||||
$physmem=`/sbin/sysctl -a hw.physmem`;
|
if ( $^O =~ /bsd/ ){
|
||||||
chomp( $physmem );
|
$physmem=`/sbin/sysctl -a hw.physmem`;
|
||||||
$physmem=~s/^.*\: //;
|
chomp( $physmem );
|
||||||
|
$physmem=~s/^.*\: //;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $line_int=1;
|
my $line_int=1;
|
||||||
|
|
Loading…
Reference in New Issue