summaryrefslogtreecommitdiff
path: root/Xext
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
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')
-rw-r--r--Xext/shm.c5
-rw-r--r--Xext/xf86bigfont.c6
2 files changed, 4 insertions, 7 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;
}
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index 95b537170..97596ea5f 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -96,8 +96,6 @@ static Bool badSysCall = FALSE;
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
-#include <sys/signal.h>
-
static void
SigSysHandler(int signo)
{
@@ -111,7 +109,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);
@@ -123,7 +121,7 @@ CheckForShmSyscall(void)
/* Allocation failed */
badSysCall = TRUE;
}
- signal(SIGSYS, oldHandler);
+ OsSignal(SIGSYS, oldHandler);
return !badSysCall;
}