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:
Adam Jackson
2016-06-07 15:52:11 -04:00
parent 8174daa6bd
commit 6178b1c91c
14 changed files with 22 additions and 34 deletions

View File

@@ -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;
}