[PATCH 1/6] Add global variable inSignalContext

Chase Douglas chase.douglas at canonical.com
Fri Apr 6 11:25:54 PDT 2012


This will be used for checking for proper logging when in signal
context.

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>

fix signal context var
---
 hw/xfree86/os-support/shared/sigio.c |    4 ++++
 include/globals.h                    |    1 +
 os/utils.c                           |    2 ++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index 12ae8a4..231d6c0 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -99,6 +99,8 @@ xf86SIGIO(int sig)
     int save_errno = errno;     /* do not clobber the global errno */
     int r;
 
+    inSignalContext = TRUE;
+
     ready = xf86SigIOMask;
     to.tv_sec = 0;
     to.tv_usec = 0;
@@ -114,6 +116,8 @@ xf86SIGIO(int sig)
     }
     /* restore global errno */
     errno = save_errno;
+
+    inSignalContext = FALSE;
 }
 
 static int
diff --git a/include/globals.h b/include/globals.h
index d147df9..f033a45 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -23,6 +23,7 @@ extern _X_EXPORT int GrabInProgress;
 extern _X_EXPORT Bool noTestExtensions;
 extern _X_EXPORT char *SeatId;
 extern _X_EXPORT char *ConnectionInfo;
+extern _X_EXPORT Bool inSignalContext;
 
 #ifdef DPMSExtension
 extern _X_EXPORT CARD32 DPMSStandbyTime;
diff --git a/os/utils.c b/os/utils.c
index 30592d2..ecf78e5 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -204,6 +204,8 @@ int auditTrailLevel = 1;
 
 char *SeatId = NULL;
 
+Bool inSignalContext = FALSE;
+
 #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
 #define HAS_SAVED_IDS_AND_SETEUID
 #endif
-- 
1.7.9.1



More information about the xorg-devel mailing list