]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix signal handling in aclocal.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 18 Nov 2007 14:30:01 +0000 (15:30 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 18 Nov 2007 14:30:01 +0000 (15:30 +0100)
* aclocal.in (unlink_tmp): If invoked by a signal, note so
in verbose mode.  Reinstall default signal handler and reraise,
to transport the interrupt information.

ChangeLog
aclocal.in

index c80196c043f283bf156f9f9f5134a815228378a3..c4ef88d248b7704bce64715a50957d25a609ee86 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix signal handling in aclocal.
+       * aclocal.in (unlink_tmp): If invoked by a signal, note so
+       in verbose mode.  Reinstall default signal handler and reraise,
+       to transport the interrupt information.
+
 2007-11-13  Bob Proulx  <bob@proulx.com>
 
        Fix color test failure on dumb (and other) terminals.
index eac545feb70edc56141415ae518818fb678891b2..195ef818c198e495e5359a63532f3fb59de56f19 100644 (file)
@@ -150,14 +150,27 @@ my $erase_me;
 \f
 ################################################################
 
-# Erase temporary file ERASE_ME.
+# Erase temporary file ERASE_ME.  Handle signals.
 sub unlink_tmp
 {
+  my ($sig) = @_;
+
+  if ($sig)
+    {
+      verb "caught SIG$sig, bailing out";
+    }
   if (defined $erase_me && -e $erase_me && !unlink ($erase_me))
     {
       fatal "could not remove `$erase_me': $!";
     }
   undef $erase_me;
+
+  # reraise default handler.
+  if ($sig)
+    {
+      $SIG{$sig} = 'DEFAULT';
+      kill $sig => $$;
+    }
 }
 
 $SIG{'INT'} = $SIG{'TERM'} = $SIG{'QUIT'} = $SIG{'HUP'} = 'unlink_tmp';