From e901a56b3b30b22f16bc9c6460150b2b402b4ee7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 21 May 2021 10:28:25 +0000 Subject: treewide: favor open(..., '+<&=', $fd) Cut down on unnecessary imports of IO::Handle and method lookup + dispatch overhead. --- t/epoll.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/epoll.t b/t/epoll.t index f2a68904..f346b387 100644 --- a/t/epoll.t +++ b/t/epoll.t @@ -1,11 +1,14 @@ +#!perl -w +# Copyright (C) 2020-2021 all contributors +# License: AGPL-3.0+ use strict; +use v5.10.1; use Test::More; -use IO::Handle; use PublicInbox::Syscall qw(:epoll); plan skip_all => 'not Linux' if $^O ne 'linux'; my $epfd = epoll_create(); ok($epfd >= 0, 'epoll_create'); -my $hnd = IO::Handle->new_from_fd($epfd, 'r+'); # close on exit +open(my $hnd, '+<&=', $epfd); # for autoclose pipe(my ($r, $w)) or die "pipe: $!"; is(epoll_ctl($epfd, EPOLL_CTL_ADD, fileno($w), EPOLLOUT), 0, -- cgit v1.2.3-24-ge0c7