avoid re-setting the exit code after waiting for upgrade monitoring process to terminate
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Wed, 27 Oct 2010 03:18:52 +0000 (23:18 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Wed, 27 Oct 2010 03:18:52 +0000 (23:18 -0400)
Crypt/Monkeysphere/MSVA/Monitor.pm

index aad42b7811559a851c5749bdc5cfd5a4d6e266f6..237e55b3f5776d3067a7df2369ab384ef1abbd8e 100644 (file)
@@ -161,9 +161,10 @@ Would you like to restart the validation agent?");
   sub DESTROY {
     my $self = shift;
     if (defined $self->{monitorpid}) {
-      # SIGTERM is 15:
-      kill(15, $self->{monitorpid});
+      kill('TERM', $self->{monitorpid});
+      my $oldexit = $?;
       waitpid($self->{monitorpid}, 0);
+      $? = $oldexit;
       undef($self->{monitorpid});
     }
   }