Pārlūkot izejas kodu

Merge pull request #425 from preaction/fix-macos-kill

fix search for unix binary on MacOS
George S. Baugh 6 gadi atpakaļ
vecāks
revīzija
65480037f0
1 mainītis faili ar 1 papildinājumiem un 2 dzēšanām
  1. 1 2
      lib/Selenium/CanStartBinary.pm

+ 1 - 2
lib/Selenium/CanStartBinary.pm

@@ -423,8 +423,7 @@ sub shutdown_unix_binary {
     my ($self) = @_;
     if (!IS_WIN) {
         my $cmd = "lsof -t -i :".$self->port();
-        my $pid = `$cmd`;
-        chomp $pid;
+        my ( $pid ) = grep { $_ && $_ ne $$ } split /\s+/, scalar `$cmd`;
         if ($pid) {
             print "Killing Driver PID $pid listening on port ".$self->port."...\n";
             eval { kill 'KILL', $pid };