From 80189a995770069fa3f77b05916c61addaefdc97 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 7 Jan 2025 18:46:23 +0100 Subject: [PATCH] t/lei-sigpipe.t: use correct pipe size According to fcntl(2), Linux will round up pipe sizes lower than a page to a whole page. Additionally, the kernel may use a larger size in general, "if that is convenient for the implementation". The actual size of the pipe is returned from fcntl, so the test should use that return value, rather than assuming the size requested was accepted exactly. This fixes the test on my system with 16K pages. --- t/lei-sigpipe.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/lei-sigpipe.t b/t/lei-sigpipe.t index b9fd88a67..c01d9f836 100644 --- a/t/lei-sigpipe.t +++ b/t/lei-sigpipe.t @@ -33,8 +33,8 @@ test_lei(sub { my $imported; for my $out ([], [qw(-f mboxcl2)], [qw(-f text)]) { pipe(my $r, my $w); - my $size = $F_SETPIPE_SZ && fcntl($w, $F_SETPIPE_SZ, 4096) ? - 4096 : 65536; + my $size = ($F_SETPIPE_SZ && fcntl($w, $F_SETPIPE_SZ, 4096)) || + 65536; unless (-f $f) { my $fh = write_file '>', $f, <<'EOM'; From: big@example.com -- 2.47.3