From: Stephen L Johnson Date: Mon, 10 Jun 2002 20:34:58 +0000 (+0000) Subject: added __DIE__ handler to reset alarm(0) if socket can't connect due to X-Git-Tag: spong-2_8_0-beta1~75 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=761c84c8e6a40e2ed22e904dcb871e0233e7458f;p=spong.git added __DIE__ handler to reset alarm(0) if socket can't connect due to explicit network error --- diff --git a/src/spong-network.pl b/src/spong-network.pl index d237636..90afa19 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -17,7 +17,7 @@ # (2) Converted checks to new plugin mechanism (Stephen Johnson May 28, 1999) # Added user-configurable escalation mechanism # -# $Id: spong-network.pl,v 1.42 2002/06/10 20:33:09 sljohnson Exp $ +# $Id: spong-network.pl,v 1.43 2002/06/10 20:34:58 sljohnson Exp $ use Carp; use lib "@@LIBDIR@@"; @@ -366,6 +366,7 @@ sub check_tcp { eval { local $SIG{'ALRM'} = sub { die "Socket timed out"; }; + local $SIG{'__DIE__'} = sub { alarm(0); }; # Reset the alarm when dead alarm($timeout); socket( SOCK, PF_INET, SOCK_STREAM, $proto ) || die "socket: $!";