From e75daedf17b0b589aeb5c8b79c02985be0a55a6c Mon Sep 17 00:00:00 2001
From: Magnus Svensson <msvensson@mysql.com>
Date: Wed, 8 Oct 2008 20:25:28 +0200
Subject: [PATCH] WL4189 Active state perl fixes

---
 mysql-test/lib/My/Platform.pm    | 8 +++++---
 mysql-test/lib/My/SafeProcess.pm | 8 ++++++++
 mysql-test/lib/My/SysInfo.pm     | 2 +-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm
index 96e22e54ded..25233753ccd 100644
--- a/mysql-test/lib/My/Platform.pm
+++ b/mysql-test/lib/My/Platform.pm
@@ -65,9 +65,11 @@ BEGIN {
 #
 
 use Memoize;
-memoize('mixed_path');
-memoize('native_path');
-memoize('posix_path');
+if (!IS_WIN32PERL){
+  memoize('mixed_path');
+  memoize('native_path');
+  memoize('posix_path');
+}
 
 sub mixed_path {
   my ($path)= @_;
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index 83749514622..5ff51146071 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -212,6 +212,14 @@ sub timer {
   };
 
   $0= "safe_timer($duration)";
+
+  if (IS_WIN32PERL){
+    # Just a thread in same process
+    sleep($duration);
+    print STDERR "timer $$: expired after $duration seconds\n";
+    exit(0);
+  }
+
   my $count_down= $duration;
   while($count_down--){
 
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
index 88a6d3dc4b9..8cb399c73ba 100644
--- a/mysql-test/lib/My/SysInfo.pm
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -76,7 +76,7 @@ sub _kstat {
   my ($self)= @_;
   while (1){
     my $instance_num= $self->{cpus} ? @{$self->{cpus}} : 0;
-    my $list= `kstat -p -m cpu_info -i $instance_num`;
+    my $list= `kstat -p -m cpu_info -i $instance_num 2> /dev/null`;
     my @lines= split('\n', $list) or last; # Break loop
 
     my $cpuinfo= {};
-- 
2.30.9