unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: Alyssa Ross <hi@alyssa.is>
Cc: meta@public-inbox.org
Subject: Re: [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size
Date: Tue, 7 Jan 2025 22:22:36 +0000	[thread overview]
Message-ID: <20250107222236.M391840@dcvr> (raw)
In-Reply-To: <20250107174624.1504268-1-hi@alyssa.is>

Alyssa Ross <hi@alyssa.is> wrote:
> 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.

Good catch, will apply.  Thanks.

> --- 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;

      parent reply	other threads:[~2025-01-07 22:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-09 16:59       ` Alyssa Ross
2025-01-07 22:22 ` Eric Wong [this message]

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=20250107222236.M391840@dcvr \
    --to=e@80x24.org \
    --cc=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).