diff options
Diffstat (limited to 'lib/PublicInbox/DS.pm')
-rw-r--r-- | lib/PublicInbox/DS.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index d6ef0b8d..e3479e66 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -142,15 +142,17 @@ sub _InitPoller return if $DoneInit; $DoneInit = 1; - if (!PublicInbox::Syscall::epoll_defined()) { - $Epoll = eval { - require PublicInbox::DSKQXS; - PublicInbox::DSKQXS->import; - PublicInbox::DSKQXS->new; - }; - } else { + if (PublicInbox::Syscall::epoll_defined()) { $Epoll = epoll_create(); set_cloexec($Epoll) if (defined($Epoll) && $Epoll >= 0); + } else { + my $cls; + for (qw(DSKQXS DSPoll)) { + $cls = "PublicInbox::$_"; + last if eval "require $cls"; + } + $cls->import; + $Epoll = $cls->new; } *EventLoop = *EpollEventLoop; } |