consistently use _NSIG/8 idiom for kernel sigset size in sigaction
this code in sigaction was the only place where sizeof was being applied to the kernel sigaction's mask member to get the size argument to pass to the kernel. everywhere else, _NSIG/8 is used for this purpose.
This commit is contained in:
@@ -53,9 +53,9 @@ int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigact
|
||||
ksa.handler = sa->sa_handler;
|
||||
ksa.flags = sa->sa_flags | SA_RESTORER;
|
||||
ksa.restorer = (sa->sa_flags & SA_SIGINFO) ? __restore_rt : __restore;
|
||||
memcpy(&ksa.mask, &sa->sa_mask, sizeof ksa.mask);
|
||||
memcpy(&ksa.mask, &sa->sa_mask, _NSIG/8);
|
||||
}
|
||||
int r = __syscall(SYS_rt_sigaction, sig, sa?&ksa:0, old?&ksa_old:0, sizeof ksa.mask);
|
||||
int r = __syscall(SYS_rt_sigaction, sig, sa?&ksa:0, old?&ksa_old:0, _NSIG/8);
|
||||
if (sig == SIGABRT && sa && sa->sa_handler != SIG_DFL) {
|
||||
UNLOCK(__abort_lock);
|
||||
__restore_sigs(&set);
|
||||
@@ -63,7 +63,7 @@ int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigact
|
||||
if (old && !r) {
|
||||
old->sa_handler = ksa_old.handler;
|
||||
old->sa_flags = ksa_old.flags;
|
||||
memcpy(&old->sa_mask, &ksa_old.mask, sizeof ksa_old.mask);
|
||||
memcpy(&old->sa_mask, &ksa_old.mask, _NSIG/8);
|
||||
}
|
||||
return __syscall_ret(r);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user