From f8e35ebbe71eed74ccf68af8ccda4182f1edc7f0 Mon Sep 17 00:00:00 2001
From: marha <marha@users.sourceforge.net>
Date: Tue, 7 Aug 2012 07:51:02 +0200
Subject: mesa xserver xkeyboard-config git update 7 Aug 2012

---
 xorg-server/os/utils.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

(limited to 'xorg-server/os')

diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index d902523be..947f8673a 100644
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -1186,6 +1186,7 @@ OsBlockSignals(void)
 
 #ifdef SIG_BLOCK
 static sig_atomic_t sigio_blocked;
+static sigset_t PreviousSigIOMask;
 #endif
 
 /**
@@ -1198,13 +1199,13 @@ OsBlockSIGIO(void)
 #ifdef SIGIO
 #ifdef SIG_BLOCK
     if (sigio_blocked++ == 0) {
-        sigset_t set, old;
+        sigset_t set;
         int ret;
 
         sigemptyset(&set);
         sigaddset(&set, SIGIO);
-        sigprocmask(SIG_BLOCK, &set, &old);
-        ret = sigismember(&old, SIGIO);
+        sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask);
+        ret = sigismember(&PreviousSigIOMask, SIGIO);
         return ret;
     } else
         return 1;
@@ -1218,11 +1219,7 @@ OsReleaseSIGIO(void)
 #ifdef SIGIO
 #ifdef SIG_BLOCK
     if (--sigio_blocked == 0) {
-        sigset_t set;
-
-        sigemptyset(&set);
-        sigaddset(&set, SIGIO);
-        sigprocmask(SIG_UNBLOCK, &set, NULL);
+        sigprocmask(SIG_SETMASK, &PreviousSigIOMask, 0);
     } else if (sigio_blocked < 0) {
         BUG_WARN(sigio_blocked < 0);
         sigio_blocked = 0;
@@ -1583,7 +1580,7 @@ Win32TempDir()
     if (getenv("TEMP") != NULL)
         return getenv("TEMP");
     else if (getenv("TMP") != NULL)
-        return getenv("TEMP");
+        return getenv("TMP");
     else
         return "/tmp";
 }
-- 
cgit v1.2.3