aboutsummaryrefslogtreecommitdiffstats
path: root/interimap
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-09-10 20:39:50 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-09-10 23:11:08 +0200
commitea086d30d021f7c018e4d307223162cf051de336 (patch)
tree5068501024c6b5dbb589d852f7dca6da60437dfe /interimap
parent705ea1c708c676587ae4833fc1fca5caafe1dd7f (diff)
Print IMAP traffic stats when receiving a SIGHUP.
Diffstat (limited to 'interimap')
-rwxr-xr-xinterimap5
1 files changed, 3 insertions, 2 deletions
diff --git a/interimap b/interimap
index 2c72d56..4a8bde4 100755
--- a/interimap
+++ b/interimap
@@ -118,8 +118,9 @@ sub cleanup() {
close $LOGGER_FD if defined $LOGGER_FD;
$DBH->disconnect() if defined $DBH;
}
-$SIG{$_} = sub { msg(undef, $!); cleanup(); exit 1; } foreach qw/INT/;
-$SIG{$_} = sub { cleanup(); exit 0; } foreach qw/HUP TERM/;
+$SIG{INT} = sub { msg(undef, $!); cleanup(); exit 1; };
+$SIG{TERM} = sub { cleanup(); exit 0; };
+$SIG{HUP} = sub { $_->stats() foreach grep defined, ($lIMAP, $rIMAP); };
#############################################################################