From f46fe2757316865bcf682470bb7a2b7106b40d65 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Mon, 20 Mar 2000 02:55:34 +0000 Subject: [PATCH] moved alarm(0) statement to inside eval statement where it belongs --- src/lib/Spong/Status.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/Spong/Status.pm b/src/lib/Spong/Status.pm index 37fafc8..8df6cfd 100755 --- a/src/lib/Spong/Status.pm +++ b/src/lib/Spong/Status.pm @@ -42,6 +42,7 @@ sub status { # Set an alarm on this block in case we run into problem talking to # the spong server. + eval { local $SIG{'ALRM'} = sub { die; }; alarm(30); @@ -52,9 +53,9 @@ sub status { undef $sock; $ok = 1; - } + alarm(0); + }; - alarm(0); warn scalar(localtime) . " can't connect to spong server.\n" if ! $ok; } @@ -76,6 +77,7 @@ sub event { # Set an alarm on this block in case we run into problem talking to # the spong server. + eval { local $SIG{'ALRM'} = sub { die; }; alarm(30); @@ -86,9 +88,9 @@ sub event { undef $sock; $ok = 1; - } + alarm(0); + }; - alarm(0); warn scalar(localtime) . " can't connect to spong server.\n" if ! $ok; } @@ -110,6 +112,7 @@ sub page { # Set an alarm on this block in case we run into problem talking to # the spong server. + eval { local $SIG{'ALRM'} = sub { die; }; alarm(30); @@ -120,9 +123,9 @@ sub page { undef $sock; $ok = 1; - } + alarm(0); + }; - alarm(0); warn scalar(localtime) . " can't connect to spong server.\n" if ! $ok; } -- 2.30.2