summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-06-28 13:55:51 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-06-28 13:55:51 +0100
commit59d15f68d4fd9bb8d673a08ed1cf767f99212ffb (patch)
tree73fbf88165bfa8ddd1f186238a6bb00fcd28cb0a
parentbf732b8843c688dffd5f6db9b9922263bffa7a1b (diff)
parent42f573005cc4a0a489cd5771f5a2178cc33478b3 (diff)
Merge branch 'cygwin-patches-for-1.12' into cygwin-release-1.12
Conflicts: hw/xwin/glx/indirect.c os/osinit.c os/utils.c
-rw-r--r--hw/xwin/glx/indirect.c27
-rw-r--r--hw/xwin/winclipboardthread.c2
-rw-r--r--hw/xwin/winmultiwindowwm.c4
-rw-r--r--os/log.c7
-rw-r--r--os/osinit.c47
-rw-r--r--os/utils.c10
6 files changed, 58 insertions, 39 deletions
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index e8292a445..14d99fe1c 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -86,6 +86,7 @@
#include <winpriv.h>
#include <wgl_ext_api.h>
+#include <winglobals.h>
#define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1]))
@@ -341,6 +342,11 @@ swap_method_name(int mthd)
static void
fbConfigsDump(unsigned int n, __GLXconfig *c)
{
+ LogMessage(X_INFO, "%d fbConfigs\n", n);
+
+ if (g_iLogVerbose < 3)
+ return;
+
ErrorF("%d fbConfigs\n", n);
ErrorF
("pxf vis fb render Ste aux accum MS drawable Group/\n");
@@ -592,11 +598,14 @@ glxWinScreenProbe(ScreenPtr pScreen)
gl_renderer = (const char *)glGetStringWrapperNonstatic(GL_RENDERER);
ErrorF("GL_RENDERER: %s\n", gl_renderer);
gl_extensions = (const char *)glGetStringWrapperNonstatic(GL_EXTENSIONS);
- glxLogExtensions("GL_EXTENSIONS: ", gl_extensions);
wgl_extensions = wglGetExtensionsStringARBWrapper(hdc);
- if (!wgl_extensions)
- wgl_extensions = "";
- glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
+ if (!wgl_extensions) wgl_extensions = "";
+
+ if (g_iLogVerbose >= 3)
+ {
+ glxLogExtensions("GL_EXTENSIONS: ", gl_extensions);
+ glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
+ }
if (strcasecmp(gl_renderer, "GDI Generic") == 0)
{
@@ -1807,10 +1816,8 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen *screen)
screen->base.fbconfigs = NULL;
// get the number of pixelformats
- numConfigs =
- DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL);
- GLWIN_DEBUG_MSG("DescribePixelFormat says %d possible pixel formats",
- numConfigs);
+ numConfigs = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL);
+ LogMessage(X_INFO, "%d pixel formats reported by DescribePixelFormat\n", numConfigs);
/* alloc */
result = malloc(sizeof(GLXWinConfig) * numConfigs);
@@ -2055,9 +2062,7 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen *screen)
return;
}
- GLWIN_DEBUG_MSG
- ("wglGetPixelFormatAttribivARB says %d possible pixel formats",
- numConfigs);
+ LogMessage(X_INFO, "%d pixel formats reported by wglGetPixelFormatAttribivARB\n", numConfigs);
/* alloc */
result = malloc(sizeof(GLXWinConfig) * numConfigs);
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index 27024e401..8de7d2f25 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -475,7 +475,7 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr)
static int
winClipboardIOErrorHandler (Display *pDisplay)
{
- ErrorF ("winClipboardIOErrorHandler!\n\n");
+ ErrorF ("winClipboardIOErrorHandler!\n");
if (pthread_equal(pthread_self(), g_winClipboardProcThread)) {
/* Restart at the main entry point */
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 73b55e3ee..23120ae60 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1522,7 +1522,7 @@ winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
static int
winMultiWindowWMIOErrorHandler (Display *pDisplay)
{
- ErrorF ("winMultiWindowWMIOErrorHandler!\n\n");
+ ErrorF ("winMultiWindowWMIOErrorHandler!\n");
if (pthread_equal(pthread_self(), g_winMultiWindowWMThread)) {
if (g_shutdown)
@@ -1562,7 +1562,7 @@ winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr)
static int
winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay)
{
- ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n\n");
+ ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n");
if (pthread_equal(pthread_self(), g_winMultiWindowXMsgProcThread)) {
/* Restart at the main entry point */
diff --git a/os/log.c b/os/log.c
index 669b82eae..6f558806c 100644
--- a/os/log.c
+++ b/os/log.c
@@ -588,9 +588,9 @@ FatalError(const char *f, ...)
static Bool beenhere = FALSE;
if (beenhere)
- ErrorF("\nFatalError re-entered, aborting\n");
+ ErrorF("FatalError re-entered, aborting\n");
else
- ErrorF("\nFatal server error:\n");
+ ErrorF("Fatal server error: ");
va_start(args, f);
#ifdef __APPLE__
@@ -605,7 +605,8 @@ FatalError(const char *f, ...)
#endif
VErrorF(f, args);
va_end(args);
- ErrorF("\n");
+ if (f[strlen(f)-1] != '\n')
+ ErrorF("\n");
if (!beenhere)
OsVendorFatalError();
if (!beenhere) {
diff --git a/os/osinit.c b/os/osinit.c
index 702493f4d..b292ae34f 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -81,6 +81,7 @@ int limitStackSpace = -1;
#ifdef RLIMIT_NOFILE
int limitNoFile = -1;
#endif
+extern Bool install_os_signal_handler;
static OsSigWrapperPtr OsSigWrapper = NULL;
@@ -120,8 +121,7 @@ OsSigHandler(int signo)
}
}
- /* log, cleanup, and abort */
- xorg_backtrace();
+ ErrorF("Fatal signal received in thread 0x%x\n", pthread_self());
#ifdef SA_SIGINFO
if (sip->si_code == SI_USER) {
@@ -139,6 +139,9 @@ OsSigHandler(int signo)
}
#endif
+ /* log, cleanup, and abort */
+ xorg_backtrace();
+
FatalError("Caught signal %d (%s). Server aborting\n",
signo, strsignal(signo));
}
@@ -151,32 +154,34 @@ OsInit(void)
char fname[PATH_MAX];
if (!been_here) {
- struct sigaction act, oact;
- int i;
-
- int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
- SIGSYS,
- SIGXCPU,
- SIGXFSZ,
+ if (install_os_signal_handler)
+ {
+ struct sigaction act, oact;
+ int i;
+ int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
+ SIGSYS,
+ SIGXCPU,
+ SIGXFSZ,
#ifdef SIGEMT
- SIGEMT,
+ SIGEMT,
#endif
- 0 /* must be last */
- };
- sigemptyset(&act.sa_mask);
+ 0 /* must be last */ };
+ sigemptyset(&act.sa_mask);
#ifdef SA_SIGINFO
- act.sa_sigaction = OsSigHandler;
- act.sa_flags = SA_SIGINFO;
+ act.sa_sigaction = OsSigHandler;
+ act.sa_flags = SA_SIGINFO;
#else
- act.sa_handler = OsSigHandler;
- act.sa_flags = 0;
+ act.sa_handler = OsSigHandler;
+ act.sa_flags = 0;
#endif
- for (i = 0; siglist[i] != 0; i++) {
+ for (i = 0; siglist[i] != 0; i++) {
if (sigaction(siglist[i], &act, &oact)) {
- ErrorF("failed to install signal handler for signal %d: %s\n",
- siglist[i], strerror(errno));
+ ErrorF("failed to install signal handler for signal %d: %s\n",
+ siglist[i], strerror(errno));
}
- }
+ }
+ }
+
#ifdef HAVE_BACKTRACE
/*
* initialize the backtracer, since the ctor calls dlopen(), which
diff --git a/os/utils.c b/os/utils.c
index 94ee19cd5..8355fafb4 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -121,6 +121,8 @@ __stdcall unsigned long GetTickCount(void);
#include "picture.h"
+Bool install_os_signal_handler = TRUE;
+
Bool noTestExtensions;
#ifdef COMPOSITE
@@ -502,6 +504,7 @@ UseMsg(void)
#ifdef RLIMIT_STACK
ErrorF("-ls int limit stack space to N Kb\n");
#endif
+ ErrorF("-notrapsignals disable catching of fatal signals\n");
ErrorF("-nolock disable the locking mechanism\n");
ErrorF("-nolisten string don't listen on protocol\n");
ErrorF("-noreset don't reset after last client exists\n");
@@ -745,7 +748,12 @@ ProcessCommandLine(int argc, char *argv[])
UseMsg();
}
#endif
- else if (strcmp(argv[i], "-nolock") == 0) {
+ else if ( strcmp ( argv[i], "-notrapsignals") == 0)
+ {
+ install_os_signal_handler = FALSE;
+ }
+ else if ( strcmp ( argv[i], "-nolock") == 0)
+ {
#if !defined(WIN32) && !defined(__CYGWIN__)
if (getuid() != 0)
ErrorF