diff options
Diffstat (limited to 'xorg-server/hw/xwin/winerror.c')
-rw-r--r-- | xorg-server/hw/xwin/winerror.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/xorg-server/hw/xwin/winerror.c b/xorg-server/hw/xwin/winerror.c index 9ed27c3d0..7cbfd65e2 100644 --- a/xorg-server/hw/xwin/winerror.c +++ b/xorg-server/hw/xwin/winerror.c @@ -41,9 +41,10 @@ /* References to external symbols */ extern char * g_pszCommandLine; -extern char * g_pszLogFile; +extern const char * g_pszLogFile; extern Bool g_fSilentFatalError; - +extern Bool g_fSilentDupError; +extern Bool g_fLogInited; #ifdef DDXOSVERRORF /* Prototype */ @@ -62,6 +63,24 @@ OsVendorVErrorF (const char *pszFormat, va_list va_args) pthread_mutex_lock (&s_pmPrinting); #endif + /* + If we want to silence it, + detect if we are going to abort due to duplication error + */ + if (g_fSilentDupError) + { + if ((strcmp(pszFormat, + "InitOutput - Duplicate invocation on display " + "number: %s. Exiting.\n") == 0) + || (strcmp(pszFormat, + "Server is already active for display %s\n%s %s\n%s\n") == 0) + || (strcmp(pszFormat, + "MakeAllCOTSServerListeners: server already running\n") == 0)) + { + g_fSilentFatalError = TRUE; + } + } + /* Print the error message to a log file, could be stderr */ LogVWrite (0, pszFormat, va_args); @@ -87,6 +106,12 @@ OsVendorFatalError (void) if (g_fSilentFatalError) return; + if (!g_fLogInited) { + g_fLogInited = TRUE; + g_pszLogFile = LogInit (g_pszLogFile, NULL); + } + LogClose (); + winMessageBoxF ( "A fatal error has occurred and " PROJECT_NAME " will now exit.\n" \ "Please open %s for more information.\n", |