Skip Menu |
 

This queue is for tickets about the Linux-Epoll CPAN distribution.

Report information
The Basics
Id: 124934
Status: open
Priority: 0/
Queue: Linux-Epoll

People
Owner: Nobody in particular
Requestors: DBOOK [...] cpan.org
Cc: oleg [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Tied handles not watched correctly
Download (untitled) / with headers
text/plain 633b
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}; }
Download (untitled) / with headers
text/plain 912b
On Tue Mar 27 00:45:56 2018, DBOOK wrote: Show quoted text
> As reported to https://rt.cpan.org/Ticket/Display.html?id=124932 - > from oleg's message: >
> > 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}; > }
It had never occurred to me to implement this. I guess this can be made to work, but it does feel rather dirty and fragile. Could you write a full test for me? Leon


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.