diff options
| author | zhangjing <[email protected]> | 2024-10-22 15:12:23 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2024-10-22 20:59:05 +0800 |
| commit | fed7c9acdac3d17cfb319d30944270adadeedee9 (patch) | |
| tree | f9029d90b1b82e2647e333ba5a7e56fc5b7e8641 /src | |
| parent | cfe1768815df56ed2b8f4c2909cb7c5684fad752 (diff) | |
[src][signal]:fix issue with inconsistency between sig_mask and sigaddset implementations when using musl libc
Diffstat (limited to 'src')
| -rw-r--r-- | src/signal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/signal.c b/src/signal.c index ace2dd1f4c..b33e24220e 100644 --- a/src/signal.c +++ b/src/signal.c @@ -30,7 +30,11 @@ #define DBG_LVL DBG_WARNING #include <rtdbg.h> -#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; |
