Skip to content

Commit

Permalink
[src][signal]:fix issue with inconsistency between sig_mask and sigad…
Browse files Browse the repository at this point in the history
…dset implementations when using musl libc
  • Loading branch information
zhangjing0303 authored and Rbb666 committed Oct 22, 2024
1 parent cfe1768 commit fed7c9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fed7c9a

Please sign in to comment.