Subject: | Tied handles not watched correctly |
As reported to https://rt.cpan.org/Ticket/Display.html?id=124932 - from oleg's message:
Show quoted text
> Problem is here: https://metacpan.org/source/LEONT/Linux-Epoll-0.012/lib/Linux/Epoll.xs#L19 . This function returns -1 for tied handle. And here is minimal script to reproduce the issue:
use strict;
use Linux::Epoll;
use Symbol;
my $epoll = Linux::Epoll->new();
my $fh = Symbol::gensym(); # \*STDIN;
tie *$fh, 'TiedHandle', 0;
$epoll->add($fh, 'in', sub {
my $events = shift;
});
print "Ok\n";
package TiedHandle;
sub TIEHANDLE {
my ($class, $fd) = @_;
bless { fd => $fd }, $class;
}
sub FILENO {
return $_[0]->{fd};
}