diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-09-01 14:14:32 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-09-01 14:14:32 -0400 |
commit | d0d212525ec7d08a4770fba97aa913ea34cafdb2 (patch) | |
tree | 3d4e0c971d62cfee315b99913a87c8ecbe9e2544 /src/signal | |
parent | 9b14ad541068d4f7d0be9bcd1ff4c70090d868d3 (diff) | |
download | musl-d0d212525ec7d08a4770fba97aa913ea34cafdb2.tar.gz musl-d0d212525ec7d08a4770fba97aa913ea34cafdb2.tar.xz musl-d0d212525ec7d08a4770fba97aa913ea34cafdb2.zip |
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.
Diffstat (limited to 'src/signal')
-rw-r--r-- | src/signal/sigaction.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/signal/sigaction.c b/src/signal/sigaction.c index 79989500..ac9a3ac2 100644 --- a/src/signal/sigaction.c +++ b/src/signal/sigaction.c @@ -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); } |