diff options
author | Eric Wong <e@80x24.org> | 2021-05-21 10:28:25 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-05-23 01:33:01 +0000 |
commit | e901a56b3b30b22f16bc9c6460150b2b402b4ee7 (patch) | |
tree | 72e971f85d251bcbb0a92c9a956ec153652f7f2f /t | |
parent | 3c1d0da4d0608b5a87371e602a911964d7c1498c (diff) | |
download | public-inbox-e901a56b3b30b22f16bc9c6460150b2b402b4ee7.tar.gz |
treewide: favor open(..., '+<&=', $fd)
Cut down on unnecessary imports of IO::Handle and method lookup + dispatch overhead.
Diffstat (limited to 't')
-rw-r--r-- | t/epoll.t | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,11 +1,14 @@ +#!perl -w +# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org> +# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> 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, |