diff options
Diffstat (limited to 'mysql-test/lib/My')
-rw-r--r-- | mysql-test/lib/My/Platform.pm | 14 | ||||
-rw-r--r-- | mysql-test/lib/My/SafeProcess.pm | 11 |
2 files changed, 13 insertions, 12 deletions
diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm index b934b08f522..1db6985771d 100644 --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm @@ -21,7 +21,7 @@ use strict; use base qw(Exporter); our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL native_path posix_path mixed_path - check_socket_path_length); + check_socket_path_length process_alive); BEGIN { if ($^O eq "cygwin") { @@ -123,4 +123,16 @@ sub check_socket_path_length { } +sub process_alive { + my ($pid)= @_; + die "usage: process_alive(pid)" unless $pid; + + return kill(0, $pid) unless IS_WINDOWS; + + my @list= split(/,/, `tasklist /FI "PID eq $pid" /NH /FO CSV`); + my $ret_pid= eval($list[1]); + return ($ret_pid == $pid); +} + + 1; diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm index 7762441496c..83749514622 100644 --- a/mysql-test/lib/My/SafeProcess.pm +++ b/mysql-test/lib/My/SafeProcess.pm @@ -100,17 +100,6 @@ else } -sub _process_alive { - my ($pid)= @_; - - return kill(0, $pid) unless IS_WINDOWS; - - my @list= split(/,/, `tasklist /FI "PID eq $pid" /NH /FO CSV`); - my $ret_pid= eval($list[1]); - return ($ret_pid == $pid); -} - - sub new { my $class= shift; |