From: Ian Jackson Date: Tue, 11 Feb 2020 17:32:25 +0000 (+0000) Subject: git-cache-proxy: Move $SIG{ALRM} setting to global X-Git-Tag: archive/debian/6.1.2~9 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=d3b21a5bf9241594626cf766bdab00fd107edafc;p=chiark-utils.git 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 --- 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;