From: Alyssa Ross <hi@alyssa.is>
To: meta@public-inbox.org
Subject: [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size
Date: Tue, 7 Jan 2025 18:46:23 +0100 [thread overview]
Message-ID: <20250107174624.1504268-1-hi@alyssa.is> (raw)
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 b9fd88a6..c01d9f83 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
base-commit: 7ec09f72bc12c3b882ba56c8bf16565f39afbc79
--
2.47.0
next reply other threads:[~2025-01-07 17:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 17:46 Alyssa Ross [this message]
2025-01-07 17:46 ` [PATCH 2/2] treewide: lose F_SETPIPE_SZ page size assumptions Alyssa Ross
2025-01-07 22:26 ` Eric Wong
2025-01-08 4:51 ` Eric Wong
2025-01-09 16:59 ` Alyssa Ross
2025-01-07 22:22 ` [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250107174624.1504268-1-hi@alyssa.is \
--to=hi@alyssa.is \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).