diff options
author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-08-20 10:29:27 +0200 |
---|---|---|
committer | Thomas Weißschuh <linux@weissschuh.net> | 2025-09-01 20:47:36 +0200 |
commit | d1ff0e2d13d6ac3a15be7870e15216726b0a809a (patch) | |
tree | 18dd003a9026f70e4d3644f6ac7f5b48bc0f2e93 /rust/helpers/processor.c | |
parent | 850047b19741490631855a475ccaa3ed29316039 (diff) |
tools/nolibc: avoid error in dup2() if old fd equals new fd
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>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20250820-nolibc-dup2-einval-v2-1-807185a45c56@linutronix.de
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'rust/helpers/processor.c')
0 files changed, 0 insertions, 0 deletions