From: Tyler Riddle Date: Sat, 15 Sep 2012 20:58:02 +0000 (-0700) Subject: fix select timeout calculation error X-Git-Tag: v0.003001_01~115 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a6786ddab559c869f448c1cb963e83faeb5efd40;p=scpubgit%2FObject-Remote.git fix select timeout calculation error --- diff --git a/lib/Object/Remote/MiniLoop.pm b/lib/Object/Remote/MiniLoop.pm index 16216de..932d0b9 100644 --- a/lib/Object/Remote/MiniLoop.pm +++ b/lib/Object/Remote/MiniLoop.pm @@ -90,7 +90,7 @@ sub unwatch_time { sub _next_timer_expires_delay { my ($self) = @_; my $timers = $self->_timers; - #undef means no timeout, only returns + #undef means no timeout, select only returns #when data is ready - when the system #deadlocks the chatter from the timeout in #select clogs up the logs @@ -103,11 +103,11 @@ sub _next_timer_expires_delay { if ($duration < 0) { $duration = 0; - } elsif (! defined($delay_max)) { - $duration = undef; - } elsif ($duration > $delay_max) { - $duration = $delay_max; + } elsif (defined $delay_max && $duration > $delay_max) { + $duration = $delay_max; } + + log_trace { "returning $duration as select() timeout period" } return $duration; }