From: Alyssa Ross Date: Tue, 7 Jan 2025 17:46:23 +0000 (+0100) Subject: t/lei-sigpipe.t: use correct pipe size X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80189a995770069fa3f77b05916c61addaefdc97;p=thirdparty%2Fpublic-inbox.git 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. --- 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