From 7d7e5013e3d2e56c48735698e39890e8f67b6b56 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 26 Jun 2019 07:58:15 +0000 Subject: ds: cleanup poll test and avoid clobbering imports On Linux systems with epoll support, we don't want to be clobbering defined subs in the t/ds-poll.t test; so use OO ->method dispatch instead and require users to explicitly import subs via EXPORT_OK. --- lib/PublicInbox/DS.pm | 2 +- lib/PublicInbox/DSKQXS.pm | 2 +- lib/PublicInbox/DSPoll.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 08f4e9e8..a8700bc5 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -151,7 +151,7 @@ sub _InitPoller $cls = "PublicInbox::$_"; last if eval "require $cls"; } - $cls->import; + $cls->import(qw(epoll_ctl epoll_wait)); $Epoll = $cls->new; } *EventLoop = *EpollEventLoop; diff --git a/lib/PublicInbox/DSKQXS.pm b/lib/PublicInbox/DSKQXS.pm index 38e13446..364df3d6 100644 --- a/lib/PublicInbox/DSKQXS.pm +++ b/lib/PublicInbox/DSKQXS.pm @@ -17,7 +17,7 @@ use parent qw(IO::KQueue); use parent qw(Exporter); use IO::KQueue; use PublicInbox::Syscall qw(EPOLLONESHOT EPOLLIN EPOLLOUT EPOLL_CTL_DEL); -our @EXPORT = qw(epoll_ctl epoll_wait); +our @EXPORT_OK = qw(epoll_ctl epoll_wait); my $owner_pid = -1; # kqueue is close-on-fork (yes, fork, not exec) # map EPOLL* bits to kqueue EV_* flags for EV_SET diff --git a/lib/PublicInbox/DSPoll.pm b/lib/PublicInbox/DSPoll.pm index e65640a8..ce7c2fac 100644 --- a/lib/PublicInbox/DSPoll.pm +++ b/lib/PublicInbox/DSPoll.pm @@ -14,7 +14,7 @@ use warnings; use parent qw(Exporter); use IO::Poll; use PublicInbox::Syscall qw(EPOLLONESHOT EPOLLIN EPOLLOUT EPOLL_CTL_DEL); -our @EXPORT = qw(epoll_ctl epoll_wait); +our @EXPORT_OK = qw(epoll_ctl epoll_wait); sub new { bless {}, $_[0] } # fd => events -- cgit v1.2.3-24-ge0c7