]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/nolibc: fix spelling of FD_SETBITMASK in FD_* macros
authorWilly Tarreau <w@1wt.eu>
Thu, 19 Jun 2025 09:30:51 +0000 (11:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 22 Jun 2025 07:14:22 +0000 (09:14 +0200)
While nolibc-test does test syscalls, it doesn't test as much the rest
of the macros, and a wrong spelling of FD_SETBITMASK in commit
feaf75658783a broke programs using either FD_SET() or FD_CLR() without
being noticed. Let's fix these macros.

Fixes: feaf75658783a ("nolibc: fix fd_set type")
Cc: stable@vger.kernel.org # v6.2+
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/include/nolibc/types.h

index 30904be544ed01b212042ebc0f4dab610f64b216..16c6e9ec9451f4c5411a92d43ecb5c7641f58381 100644 (file)
@@ -128,7 +128,7 @@ typedef struct {
                int __fd = (fd);                                        \
                if (__fd >= 0)                                          \
                        __set->fds[__fd / FD_SETIDXMASK] &=             \
-                               ~(1U << (__fd & FX_SETBITMASK));        \
+                               ~(1U << (__fd & FD_SETBITMASK));        \
        } while (0)
 
 #define FD_SET(fd, set) do {                                           \
@@ -145,7 +145,7 @@ typedef struct {
                int __r = 0;                                            \
                if (__fd >= 0)                                          \
                        __r = !!(__set->fds[__fd / FD_SETIDXMASK] &     \
-1U << (__fd & FD_SET_BITMASK));                                                \
+1U << (__fd & FD_SETBITMASK));                                         \
                __r;                                                    \
        })