From d3b21a5bf9241594626cf766bdab00fd107edafc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 11 Feb 2020 17:32:25 +0000 Subject: [PATCH] git-cache-proxy: Move $SIG{ALRM} setting to global This is actually used in multiple places. It should be set globally. No overall functional change with the current code. Signed-off-by: Ian Jackson --- scripts/git-cache-proxy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/git-cache-proxy b/scripts/git-cache-proxy index 051888a..518ca9a 100755 --- a/scripts/git-cache-proxy +++ b/scripts/git-cache-proxy @@ -145,6 +145,8 @@ sub fail ($) { exit 0; } +$SIG{ALRM} = sub { fail "timeout" }; + sub gitfail ($) { my ($msg) = @_; close LOCK; @@ -251,7 +253,6 @@ sub servinfo ($) { } sub readcommand () { - $SIG{ALRM} = sub { fail "timeout" }; alarm 30; my $hex_len = xread 4; -- 2.30.2