diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-04-06 07:43:57 -0700 |
---|---|---|
committer | Chase Douglas <chase.douglas@ubuntu.com> | 2012-05-24 09:52:23 -0700 |
commit | 9689c97b81732597a2a7f1ba4040b2f840a58e0a (patch) | |
tree | e462a9f887c6069ceeaf4f0becdb85f1d2199119 | |
parent | 3e31ae7ca854a0baba2d4262fc5ecff03b2f6a83 (diff) |
Add global variable inSignalContext
This will be used for checking for proper logging when in signal
context.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | hw/xfree86/os-support/shared/sigio.c | 4 | ||||
-rw-r--r-- | include/globals.h | 3 | ||||
-rw-r--r-- | os/utils.c | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index 12ae8a480..231d6c04f 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 8076955a9..6d3f3d708 100644 --- a/include/globals.h +++ b/include/globals.h @@ -2,6 +2,8 @@ #ifndef _XSERV_GLOBAL_H_ #define _XSERV_GLOBAL_H_ +#include <signal.h> + #include "window.h" /* for WindowPtr */ /* Global X server variables that are visible to mi, dix, os, and ddx */ @@ -23,6 +25,7 @@ extern _X_EXPORT int GrabInProgress; extern _X_EXPORT Bool noTestExtensions; extern _X_EXPORT char *SeatId; extern _X_EXPORT char *ConnectionInfo; +extern _X_EXPORT sig_atomic_t inSignalContext; #ifdef DPMSExtension extern _X_EXPORT CARD32 DPMSStandbyTime; diff --git a/os/utils.c b/os/utils.c index 3a1ef9303..2f0754886 100644 --- a/os/utils.c +++ b/os/utils.c @@ -204,6 +204,8 @@ int auditTrailLevel = 1; char *SeatId = NULL; +sig_atomic_t inSignalContext = FALSE; + #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED) #define HAS_SAVED_IDS_AND_SETEUID #endif |