File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 201201 next if $test -> {host_port } == $sshLocalPort ;
202202 my $cmd ;
203203 if ($writer eq " nc" ) {
204- $cmd = $test -> {host_socket } eq " " ? " nc -w $connectionTimeout $test ->{host_ip} $test ->{host_port}" : " nc -w $connectionTimeout -U $test ->{host_socket}" ;
204+ if ($Config {osname } eq " darwin" ) {
205+ # macOS nc doesn't support -w for connection timeout, so use -G instead
206+ $cmd = $test -> {host_socket } eq " " ? " nc -G $connectionTimeout $test ->{host_ip} $test ->{host_port}" : " nc -G $connectionTimeout -U $test ->{host_socket}" ;
207+ } else {
208+ $cmd = $test -> {host_socket } eq " " ? " nc -w $connectionTimeout $test ->{host_ip} $test ->{host_port}" : " nc -w $connectionTimeout -U $test ->{host_socket}" ;
209+ }
205210 } elsif ($writer eq " socat" ) {
206211 my $tcp_dest = $test -> {host_ip } =~ / :/ ? " TCP6:[$test ->{host_ip}]:$test ->{host_port}" : " TCP:$test ->{host_ip}:$test ->{host_port}" ;
207212 $cmd = $test -> {host_socket } eq " " ? " socat -u STDIN $tcp_dest ,connect-timeout=$connectionTimeout " : " socat -u STDIN UNIX-CONNECT:$test ->{host_socket}" ;
You can’t perform that action at this time.
0 commit comments