Merge "Add const for first argument of sigismember for fit POSIX spec"
This commit is contained in:
commit
28f82b260c
@ -57,13 +57,13 @@ typedef int sig_atomic_t;
|
|||||||
extern const char* const sys_siglist[];
|
extern const char* const sys_siglist[];
|
||||||
extern const char* const sys_signame[];
|
extern const char* const sys_signame[];
|
||||||
|
|
||||||
static __inline__ int sigismember(sigset_t* set, int signum) {
|
static __inline__ int sigismember(const sigset_t* set, int signum) {
|
||||||
int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0.
|
int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0.
|
||||||
if (set == NULL || bit < 0 || bit >= 8*sizeof(sigset_t)) {
|
if (set == NULL || bit < 0 || bit >= 8*sizeof(sigset_t)) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
unsigned long* local_set = (unsigned long*) set;
|
const unsigned long* local_set = (const unsigned long*) set;
|
||||||
return (int) ((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
|
return (int) ((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user