Ver código fonte

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

fix search for unix binary on MacOS
George S. Baugh 6 anos atrás
pai
commit
65480037f0
1 arquivos alterados com 1 adições e 2 exclusões
  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 };