From: Don Armstrong Date: Sat, 16 Jun 2007 21:13:23 +0000 (+0100) Subject: * Trap SIGINT and exit at a safe point in expire.in X-Git-Tag: release/2.6.0~547^2~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=91c2f6e99b29de586592c70dd43fdf4207c8e9dd;p=debbugs.git * Trap SIGINT and exit at a safe point in expire.in --- diff --git a/scripts/expire.in b/scripts/expire.in index 2fbdcb77..f5e0a15d 100755 --- a/scripts/expire.in +++ b/scripts/expire.in @@ -33,6 +33,8 @@ foreach my $dir (@dirs) { my $bug; my $errors=0; +our $exit_now = 0; +$SIG{INT} = sub {$exit_now=1;} #process each bug (ie, status file) while (length($bug=shift(@list))) { # Weeeee. @@ -44,6 +46,7 @@ while (length($bug=shift(@list))) { $errors=1; print STDERR "Unable to archive bug# $bug which I thought I could archive:\n$@\n"; } + last if $exit_now; } exit $errors;