unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size
@ 2025-01-07 17:46 Alyssa Ross
  2025-01-07 17:46 ` [PATCH 2/2] treewide: lose F_SETPIPE_SZ page size assumptions Alyssa Ross
  2025-01-07 22:22 ` [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size Eric Wong
  0 siblings, 2 replies; 5+ messages in thread
From: Alyssa Ross @ 2025-01-07 17:46 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-08  4:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07 17:46 [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size Alyssa Ross
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-07 22:22 ` [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size Eric Wong

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).