mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user