[svk-commit] r2305 - trunk/lib/SVK/Mirror/Backend

nobody at bestpractical.com nobody at bestpractical.com
Sun Mar 4 14:29:32 EST 2007


Author: clkao
Date: Sun Mar  4 14:29:31 2007
New Revision: 2305

Modified:
   trunk/lib/SVK/Mirror/Backend/SVNRaPipe.pm

Log:
Simplify the SIGINT handling logic in pipelined mirror.
Also kill the child process when parent is exiting prematurely.


Modified: trunk/lib/SVK/Mirror/Backend/SVNRaPipe.pm
==============================================================================
--- trunk/lib/SVK/Mirror/Backend/SVNRaPipe.pm	(original)
+++ trunk/lib/SVK/Mirror/Backend/SVNRaPipe.pm	Sun Mar  4 14:29:31 2007
@@ -248,9 +248,6 @@
     my $baton_map = {};
     my $baton_pool = {};
 
-    local $SIG{INT} = sub { kill 15, $self->pid;
-			    waitpid($self->pid, 0);
-			    die loc("Interrupted.\n") };
     eval {
 
     while ((my $data = $self->read_msg )) {
@@ -282,9 +279,16 @@
     }
     };
 
+    if ($@) {
+	kill 15, $self->pid;
+	waitpid $self->pid, 0;
+	$self->pid(undef);
+    }
+
     # destroy the remaining pool that became default pools in order.
     delete $baton_pool->{$_} 
         for reverse sort keys %$baton_pool;
+
     die $@ if $@;
 }
 


More information about the svk-commit mailing list