From fed7c9acdac3d17cfb319d30944270adadeedee9 Mon Sep 17 00:00:00 2001 From: zhangjing Date: Tue, 22 Oct 2024 15:12:23 +0800 Subject: [PATCH] [src][signal]:fix issue with inconsistency between sig_mask and sigaddset implementations when using musl libc --- src/signal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/signal.c b/src/signal.c index ace2dd1f4c4..b33e24220e4 100644 --- a/src/signal.c +++ b/src/signal.c @@ -30,7 +30,11 @@ #define DBG_LVL DBG_WARNING #include -#define sig_mask(sig_no) (1u << sig_no) +#ifdef RT_USING_MUSLLIBC + #define sig_mask(sig_no) (1u << (sig_no - 1)) +#else + #define sig_mask(sig_no) (1u << sig_no) +#endif #define sig_valid(sig_no) (sig_no >= 0 && sig_no < RT_SIG_MAX) static struct rt_spinlock _thread_signal_lock = RT_SPINLOCK_INIT;