List:Commits« Previous MessageNext Message »
From:msvensson Date:September 14 2007 1:49pm
Subject:bk commit into 5.0 tree (msvensson:1.2527)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-09-14 15:49:39+02:00, msvensson@pilot.(none) +1 -0
  Only use nonblocking when timeout is defined and set to 0

  mysql-test/lib/My/SafeProcess.pm@stripped, 2007-09-14 15:49:38+02:00, msvensson@pilot.(none) +7 -5
    Only use nonblocking when timeout is defined and set to 0

diff -Nrup a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
--- a/mysql-test/lib/My/SafeProcess.pm	2007-09-14 14:52:57 +02:00
+++ b/mysql-test/lib/My/SafeProcess.pm	2007-09-14 15:49:38 +02:00
@@ -167,15 +167,17 @@ sub wait {
     # alarm should break the wait
     local $SIG{ALRM}= sub { die "waitpid timeout"; };
 
-    alarm($timeout) if defined $timeout;
+    my $blocking= (defined $timeout and $timeout == 0) ? 0 : 1;
+
+    alarm($timeout) if $blocking;
 
     my $pid= $self->{MONITOR_PID};
-    my $retpid= waitpid($pid, $timeout ? 0 : &WNOHANG);
+    my $retpid= waitpid($pid, $blocking ? 0 : &WNOHANG);
 
-    alarm(0) if defined $timeout;
+    alarm(0) if defined $blocking;
 
-    # -1 => not running
-    return 0 if ($retpid == -1);
+    # -1 => no such process
+    return 0 if ($blocking and $retpid == -1);
 
     # 0 => still running
     return 1 if ($retpid == 0);
Thread
bk commit into 5.0 tree (msvensson:1.2527)msvensson14 Sep