git: 669516a1a16e - main - linux(4): Fix the type of a constant in the signal mask macro
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 30 May 2022 17:04:21 UTC
The branch main has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=669516a1a16efe51f85ef203c3b93e6db7a3ed51
commit 669516a1a16efe51f85ef203c3b93e6db7a3ed51
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-05-30 16:53:52 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-05-30 16:53:52 +0000
linux(4): Fix the type of a constant in the signal mask macro
Since l_sigset_t is 64-bit unsigned on all Linuxulators, fix the type
of a constant in the signal mask manipulation macro.
The suffix L indicates type long which is 32-bit on i386, therefore,
bitwise operations between a 32-bit constant and 64-bit signal mask
lead to the wrong result.
Pointy hat to: dchagin
MFC after: 2 weeks
---
sys/compat/linux/linux.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h
index 0309c4dbaaa8..cf250e29d278 100644
--- a/sys/compat/linux/linux.h
+++ b/sys/compat/linux/linux.h
@@ -118,8 +118,8 @@ typedef struct {
/* primitives to manipulate sigset_t */
#define LINUX_SIGEMPTYSET(set) (set).__mask = 0
-#define LINUX_SIGISMEMBER(set, sig) (1UL & ((set).__mask >> _SIG_IDX(sig)))
-#define LINUX_SIGADDSET(set, sig) (set).__mask |= 1UL << _SIG_IDX(sig)
+#define LINUX_SIGISMEMBER(set, sig) (1ULL & ((set).__mask >> _SIG_IDX(sig)))
+#define LINUX_SIGADDSET(set, sig) (set).__mask |= 1ULL << _SIG_IDX(sig)
void linux_to_bsd_sigset(l_sigset_t *, sigset_t *);
void bsd_to_linux_sigset(sigset_t *, l_sigset_t *);