From: Jerry D. Hedden Date: Tue, 9 Sep 2008 09:54:41 +0000 (-0400) Subject: Watchdog re-queue X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a6c9a8153fb7a55ac70f2d697cf6020eee8fc5f6;p=p5sagit%2Fp5-mst-13.2.git Watchdog re-queue From: "Jerry D. Hedden" Message-ID: <1ff86f510809090654v2de48f1r37499d573f452cdb@mail.gmail.com> Date: Tue, 9 Sep 2008 09:54:41 -0400 p4raw-id: //depot/perl@34337 --- diff --git a/t/test.pl b/t/test.pl index 8b3154e..f44e43c 100644 --- a/t/test.pl +++ b/t/test.pl @@ -909,12 +909,10 @@ sub watchdog ($) eval { require POSIX; }; # Execute the timeout - my $time_elapsed = 0; my $time_left = $timeout; - while ($time_elapsed < $timeout) { - $time_elapsed += sleep($time_left); - $time_left = $timeout - $time_elapsed; - } + do { + $time_left -= sleep($time_left); + } while ($time_left > 0); # Kill the parent (and ourself) select(STDERR); $| = 1;