Now that _poll() properly handles an empty array, this fixes
[rt.cpan.org #25049]. The commit referenced in that ticket never made
it to CPAN nor blead.
our(@ISA, @EXPORT_OK, @EXPORT, $VERSION);
@ISA = qw(Exporter);
-$VERSION = "0.09";
+$VERSION = "0.10";
@EXPORT = qw( POLLIN
POLLOUT
push(@poll,$fd => $mask);
}
- my $ret = @poll ? _poll(defined($timeout) ? $timeout * 1000 : -1,@poll) : 0;
+ my $ret = _poll(defined($timeout) ? $timeout * 1000 : -1,@poll);
return $ret
unless $ret > 0;
select(STDERR); $| = 1;
select(STDOUT); $| = 1;
-print "1..10\n";
+print "1..12\n";
use IO::Handle;
use IO::Poll qw(/POLL/);
print "not "
if $poll->poll(0.1);
print "ok 10\n";
+
+my $wait = IO::Poll->new;
+my $now = time;
+my $zero = $wait->poll(2);
+my $diff = time - $now;
+print "not " if !defined($zero) or $zero;
+print "ok 11\n";
+print "not " unless $diff >= 2;
+print "ok 12\n";