mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tools/nolibc: avoid error in dup2() if old fd equals new fd
Date: Sat, 23 Aug 2025 12:18:24 +0200	[thread overview]
Message-ID: <20250823101824.GA21040@1wt.eu> (raw)
In-Reply-To: <20250820-nolibc-dup2-einval-v2-1-807185a45c56@linutronix.de>

On Wed, Aug 20, 2025 at 10:29:27AM +0200, Thomas Weißschuh wrote:
> dup2() allows both 'old' and 'new' to have the same value, which dup3()
> does not. If libc dup2() is implemented through the dup3() system call,
> then it would incorrectly fail in this case.
> 
> Avoid the error by handling old == new explicitly.
> 
> Fixes: 30ca20517ac1 ("tools headers: Move the nolibc header from rcutorture to tools/include/nolibc/")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Good, LGTM!

Acked-by: Willy Tarreau <w@1wt.eu>

Willy

      reply	other threads:[~2025-08-23 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20  8:29 Thomas Weißschuh
2025-08-23 10:18 ` Willy Tarreau [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250823101824.GA21040@1wt.eu \
    --to=w@1wt.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=paulmck@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /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

all inboxes | Powered by JetHome®