remove +c 19

This commit is contained in:
Zane C. B-H 2019-07-28 21:03:54 -05:00
parent e9dec9c9eb
commit 928f9b465e
3 changed files with 12 additions and 6 deletions

View File

@ -1,5 +1,9 @@
Revision history for Net-Connection-lsof
0.0.1 2019-07-28/21:10
- Some versions of lsof shipped with some linux
distros don't support +c so don't use that option.
0.0.0 2019-07-28/06:40
- Initial release.

View File

@ -41,7 +41,7 @@ our $VERSION = '0.0.0';
=head2 lsof_to_nc_objects
This runs 'lsof -i UDP -i TCP -n -l +c 19 -P' and parses the output
This runs 'lsof -i UDP -i TCP -n -l -P' and parses the output
returns a array of L<Net::Connection> objects. If a non-zero exit code is
returned, it will die.
@ -89,9 +89,9 @@ sub lsof_to_nc_objects{
$func_args{uid_resolve}=1;
}
my $output_raw=`lsof -i UDP -i TCP -n -l +c 19 -P`;
my $output_raw=`lsof -i UDP -i TCP -n -l -P`;
if ( $? ne 0 ){
die('"lsof -i UDP -i TCP -n -l +c 19 -P" exited with a non-zero value');
die('"lsof -i UDP -i TCP -n -l -P" exited with a non-zero value');
}
my @output_lines=split(/\n/, $output_raw);
@ -99,8 +99,10 @@ sub lsof_to_nc_objects{
my $line_int=1;
while ( defined( $output_lines[$line_int] ) ){
my $command=substr $output_lines[$line_int], 0, 19;
my $line=substr $output_lines[$line_int], 19;
my $command=substr $output_lines[$line_int], 0, 9;
my $line=substr $output_lines[$line_int], 10;
$line=~s/^[\t ]*//;
my @line_split=split(/[\ \t]+/, $line );

View File

@ -11,7 +11,7 @@ BEGIN {
}
my $output_raw=`lsof -i UDP -i TCP -n -l +c 19 -P`;
my $output_raw=`lsof -i UDP -i TCP -n -l -P`;
if ( $? eq 0 ){
$extra_tests++;
my $worked=0;