From: Stephen L Johnson Date: Mon, 20 Mar 2000 02:55:34 +0000 (+0000) Subject: moved alarm(0) statement to inside eval statement where it belongs X-Git-Tag: spong-2_7-alpha5~26 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f46fe2757316865bcf682470bb7a2b7106b40d65;p=spong.git moved alarm(0) statement to inside eval statement where it belongs --- 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; }