summaryrefslogtreecommitdiff
path: root/Xext/shm.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-06-07 15:52:11 -0400
committerAdam Jackson <ajax@redhat.com>2016-06-08 11:36:31 -0400
commit6178b1c91cfc9e860914acc6f0be2f2d2e07a124 (patch)
treeea2fdadb27b3103f21f5d58ab4014a61953ed7a0 /Xext/shm.c
parent8174daa6bd3f0c792425a5ebef63a6a9ce7d00a4 (diff)
dix: Use OsSignal() not signal()
As the man page for the latter states: The effects of signal() in a multithreaded process are unspecified. We already have an interface to call sigaction() instead, use it. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xext/shm.c')
-rw-r--r--Xext/shm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Xext/shm.c b/Xext/shm.c
index b359a9035..0a44b7611 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -153,7 +153,6 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL };
}
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
-#include <sys/signal.h>
static Bool badSysCall = FALSE;
@@ -170,7 +169,7 @@ CheckForShmSyscall(void)
int shmid = -1;
/* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
- oldHandler = signal(SIGSYS, SigSysHandler);
+ oldHandler = OsSignal(SIGSYS, SigSysHandler);
badSysCall = FALSE;
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
@@ -183,7 +182,7 @@ CheckForShmSyscall(void)
/* Allocation failed */
badSysCall = TRUE;
}
- signal(SIGSYS, oldHandler);
+ OsSignal(SIGSYS, oldHandler);
return !badSysCall;
}