about summary refs log tree commit homepage
path: root/t/gcf2.t
diff options
context:
space:
mode:
Diffstat (limited to 't/gcf2.t')
-rw-r--r--t/gcf2.t9
1 files changed, 5 insertions, 4 deletions
diff --git a/t/gcf2.t b/t/gcf2.t
index 35b2f113..33f3bbca 100644
--- a/t/gcf2.t
+++ b/t/gcf2.t
@@ -1,5 +1,5 @@
 #!perl -w
-# Copyright (C) 2020 all contributors <meta@public-inbox.org>
+# 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 PublicInbox::TestCommon;
@@ -10,6 +10,7 @@ use POSIX qw(_exit);
 use Cwd qw(abs_path);
 require_mods('PublicInbox::Gcf2');
 use_ok 'PublicInbox::Gcf2';
+use PublicInbox::Syscall qw($F_SETPIPE_SZ);
 use PublicInbox::Import;
 my ($tmpdir, $for_destroy) = tmpdir();
 
@@ -109,12 +110,12 @@ SKIP: {
         for my $blk (1, 0) {
                 my ($r, $w);
                 pipe($r, $w) or BAIL_OUT $!;
-                fcntl($w, 1031, 4096) or
+                fcntl($w, $F_SETPIPE_SZ, 4096) or
                         skip('Linux too old for F_SETPIPE_SZ', 14);
                 $w->blocking($blk);
                 seek($fh, 0, SEEK_SET) or BAIL_OUT "seek: $!";
                 truncate($fh, 0) or BAIL_OUT "truncate: $!";
-                defined(my $pid = fork) or BAIL_OUT "fork: $!";
+                my $pid = fork // BAIL_OUT "fork: $!";
                 if ($pid == 0) {
                         close $w;
                         tick; # wait for parent to block on writev
@@ -129,7 +130,7 @@ SKIP: {
                 $ck_copying->("pipe blocking($blk)");
 
                 pipe($r, $w) or BAIL_OUT $!;
-                fcntl($w, 1031, 4096) or BAIL_OUT $!;
+                fcntl($w, $F_SETPIPE_SZ, 4096) or BAIL_OUT $!;
                 $w->blocking($blk);
                 close $r;
                 local $SIG{PIPE} = 'IGNORE';