about summary refs log tree commit diff
path: root/src/aio/lio_listio.c
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2019-06-29 18:19:04 -0500
committerRich Felker <dalias@aerifal.cx>2019-07-10 17:06:00 -0400
commite0eee3ceefd550724058ffbdf878e9eb06e18f18 (patch)
tree4c646a29132f7e8025b2755fa4d5956e08fcacdb /src/aio/lio_listio.c
parenta730639273fd5040ea3528a9fc7b8590f46a6702 (diff)
downloadmusl-e0eee3ceefd550724058ffbdf878e9eb06e18f18.tar.gz
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/aio/lio_listio.c')
-rw-r--r--src/aio/lio_listio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/aio/lio_listio.c b/src/aio/lio_listio.c
index 7b6a03d3..0799c15d 100644
--- a/src/aio/lio_listio.c
+++ b/src/aio/lio_listio.c
@@ -113,7 +113,7 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st
 
 	if (st) {
 		pthread_attr_t a;
-		sigset_t set;
+		sigset_t set, set_old;
 		pthread_t td;
 
 		if (sev->sigev_notify == SIGEV_THREAD) {
@@ -128,13 +128,13 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st
 		}
 		pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
 		sigfillset(&set);
-		pthread_sigmask(SIG_BLOCK, &set, &set);
+		pthread_sigmask(SIG_BLOCK, &set, &set_old);
 		if (pthread_create(&td, &a, wait_thread, st)) {
 			free(st);
 			errno = EAGAIN;
 			return -1;
 		}
-		pthread_sigmask(SIG_SETMASK, &set, 0);
+		pthread_sigmask(SIG_SETMASK, &set_old, 0);
 	}
 
 	return 0;