From: Stephen L Johnson Date: Mon, 7 May 2001 19:19:24 +0000 (+0000) Subject: removed close and alarm calls output of alarm/eval block in check_tcp() X-Git-Tag: spong-2_7_4^0 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8866dc7b9c1410b917b7a80043b2c00e1ae1e1f7;p=spong.git removed close and alarm calls output of alarm/eval block in check_tcp() --- diff --git a/src/spong-network.pl b/src/spong-network.pl index 4d91b6a..907f76b 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.34 2001/04/17 02:58:12 sljohnson Exp $ +# $Id: spong-network.pl,v 1.35 2001/05/07 19:19:24 sljohnson Exp $ use Carp; use lib "@@LIBDIR@@"; @@ -368,10 +368,9 @@ sub check_tcp { select((select(SOCK), $| = 1)[0]); print SOCK "$data"; recv( SOCK, $line, 256, 0 ); # just grab a chunk from the service. - close( SOCK ) || die "close: $!"; + alarm(0); + close( SOCK ) || die "close: $!"; }; - alarm(0); - close( SOCK ) || die "close: $!"; # close even if our alarm went off if ( $@ =~ /^(.*) at/ ) { $err = $1; } if ( $@ =~ /timed out/ ) { $err = "check_tcp timed out"; }