chiark / gitweb /
When killing build subprocess during failure of rpush, try reaping it (so we can...
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 59fabafb5672de394b66ca3d333ae53214a8466c..40953871a6724b8c3015a4889e47aa275daac419 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1750,12 +1750,14 @@ sub cmd_remote_push_responder {
 }
 
 our $i_tmp;
 }
 
 our $i_tmp;
-our $i_child_pid;
 
 sub i_cleanup {
 
 sub i_cleanup {
-    local ($@);
-    if ($i_child_pid) {
-       printdebug "(killing remote child $i_child_pid)\n";
+    local ($@, $?);
+    my $report = i_child_report();
+    if (defined $report) {
+       printdebug "($report)\n";
+    } elsif ($i_child_pid) {
+       printdebug "(killing build host child $i_child_pid)\n";
        kill 15, $i_child_pid;
     }
     if (defined $i_tmp && !defined $initiator_tempdir) {
        kill 15, $i_child_pid;
     }
     if (defined $i_tmp && !defined $initiator_tempdir) {