diff options
author | Samuel Holland <samuel@sholland.org> | 2019-06-29 18:19:04 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-07-10 17:06:00 -0400 |
commit | e0eee3ceefd550724058ffbdf878e9eb06e18f18 (patch) | |
tree | 4c646a29132f7e8025b2755fa4d5956e08fcacdb /src/signal/sigset.c | |
parent | a730639273fd5040ea3528a9fc7b8590f46a6702 (diff) | |
download | musl-e0eee3ceefd550724058ffbdf878e9eb06e18f18.tar.gz musl-e0eee3ceefd550724058ffbdf878e9eb06e18f18.tar.bz2 musl-e0eee3ceefd550724058ffbdf878e9eb06e18f18.tar.xz musl-e0eee3ceefd550724058ffbdf878e9eb06e18f18.zip |
fix restrict violations in internal use of several functions
The old/new parameters to pthread_sigmask, sigprocmask, and setitimer
are marked restrict, so passing the same address to both is
prohibited. Modify callers of these functions to use a separate object
for each argument.
Diffstat (limited to 'src/signal/sigset.c')
-rw-r--r-- | src/signal/sigset.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/signal/sigset.c b/src/signal/sigset.c index 0d7b4564..f3e8c407 100644 --- a/src/signal/sigset.c +++ b/src/signal/sigset.c @@ -3,7 +3,7 @@ void (*sigset(int sig, void (*handler)(int)))(int) { struct sigaction sa, sa_old; - sigset_t mask; + sigset_t mask, mask_old; sigemptyset(&mask); if (sigaddset(&mask, sig) < 0) @@ -12,7 +12,7 @@ void (*sigset(int sig, void (*handler)(int)))(int) if (handler == SIG_HOLD) { if (sigaction(sig, 0, &sa_old) < 0) return SIG_ERR; - if (sigprocmask(SIG_BLOCK, &mask, &mask) < 0) + if (sigprocmask(SIG_BLOCK, &mask, &mask_old) < 0) return SIG_ERR; } else { sa.sa_handler = handler; @@ -20,8 +20,8 @@ void (*sigset(int sig, void (*handler)(int)))(int) sigemptyset(&sa.sa_mask); if (sigaction(sig, &sa, &sa_old) < 0) return SIG_ERR; - if (sigprocmask(SIG_UNBLOCK, &mask, &mask) < 0) + if (sigprocmask(SIG_UNBLOCK, &mask, &mask_old) < 0) return SIG_ERR; } - return sigismember(&mask, sig) ? SIG_HOLD : sa_old.sa_handler; + return sigismember(&mask_old, sig) ? SIG_HOLD : sa_old.sa_handler; } |