From: Rafael Kitover Date: Fri, 20 Feb 2009 03:57:18 +0000 (+0000) Subject: added timeout to sqlite health check because some buggy versions of sqlite just hang X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=76607ac83ea26dffdbede5eae7786d60b25c57a3;p=dbsrgits%2FDBIx-Class-Historic.git added timeout to sqlite health check because some buggy versions of sqlite just hang --- diff --git a/Makefile.PL b/Makefile.PL index e116792..1a3466f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,6 +1,7 @@ use inc::Module::Install 0.67; use strict; use warnings; +use POSIX (); use 5.006001; # delete this line if you want to send patches for earlier. @@ -118,9 +119,14 @@ EOW exit 0; } else { - wait(); + eval { + local $SIG{ALRM} = sub { die "timeout\n" }; + alarm 5; + wait(); + alarm 0; + }; my $sig = $? & 127; - if ($sig == 11) { + if ($@ || $sig == POSIX::SIGSEGV) { warn (<