aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/os-support/shared/sigio.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/os-support/shared/sigio.c')
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/sigio.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/xorg-server/hw/xfree86/os-support/shared/sigio.c b/xorg-server/hw/xfree86/os-support/shared/sigio.c
index 231d6c04f..f3c153b89 100644
--- a/xorg-server/hw/xfree86/os-support/shared/sigio.c
+++ b/xorg-server/hw/xfree86/os-support/shared/sigio.c
@@ -136,7 +136,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
struct sigaction sa;
struct sigaction osa;
int i;
- int blocked;
int installed = FALSE;
if (!xf86Info.useSIGIO)
@@ -146,7 +145,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
if (!xf86SigIOFuncs[i].f) {
if (xf86IsPipe(fd))
return 0;
- blocked = xf86BlockSIGIO();
+ OsBlockSIGIO();
#ifdef O_ASYNC
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
@@ -174,7 +173,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
}
#endif
if (!installed) {
- xf86UnblockSIGIO(blocked);
+ OsReleaseSIGIO();
return 0;
}
sigemptyset(&sa.sa_mask);
@@ -190,7 +189,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
if (fd >= xf86SigIOMaxFd)
xf86SigIOMaxFd = fd + 1;
FD_SET(fd, &xf86SigIOMask);
- xf86UnblockSIGIO(blocked);
+ OsReleaseSIGIO();
return 1;
}
/* Allow overwriting of the closure and callback */
@@ -263,26 +262,13 @@ xf86RemoveSIGIOHandler(int fd)
int
xf86BlockSIGIO(void)
{
- sigset_t set, old;
- int ret;
-
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_BLOCK, &set, &old);
- ret = sigismember(&old, SIGIO);
- return ret;
+ return OsBlockSIGIO();
}
void
xf86UnblockSIGIO(int wasset)
{
- sigset_t set;
-
- if (!wasset) {
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_UNBLOCK, &set, NULL);
- }
+ OsReleaseSIGIO();
}
void