From 761c84c8e6a40e2ed22e904dcb871e0233e7458f Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Mon, 10 Jun 2002 20:34:58 +0000 Subject: [PATCH] added __DIE__ handler to reset alarm(0) if socket can't connect due to explicit network error --- src/spong-network.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: $!"; -- 2.30.2