aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winerror.c')
-rw-r--r--xorg-server/hw/xwin/winerror.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/xorg-server/hw/xwin/winerror.c b/xorg-server/hw/xwin/winerror.c
index 1318b0f36..859a66834 100644
--- a/xorg-server/hw/xwin/winerror.c
+++ b/xorg-server/hw/xwin/winerror.c
@@ -35,6 +35,7 @@
#include <../xfree86/common/xorgVersion.h>
#include "win.h"
+extern Bool g_fSilentDupError;
#ifdef DDXOSVERRORF
void
OsVendorVErrorF(const char *pszFormat, va_list va_args)
@@ -48,6 +49,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);
@@ -64,11 +83,10 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args)
*
* Attempt to do last-ditch, safe, important cleanup here.
*/
+char g_FatalErrorMessage[1024];
void
OsVendorFatalError(const char *f, va_list args)
{
- char errormsg[1024] = "";
-
/* Don't give duplicate warning if UseMsg was called */
if (g_fSilentFatalError)
return;
@@ -79,9 +97,6 @@ OsVendorFatalError(const char *f, va_list args)
}
LogClose(EXIT_ERR_ABORT);
- /* Format the error message */
- vsnprintf(errormsg, sizeof(errormsg), f, args);
-
/*
Sometimes the error message needs a bit of cosmetic cleaning
up for use in a dialog box...
@@ -89,7 +104,7 @@ OsVendorFatalError(const char *f, va_list args)
{
char *s;
- while ((s = strstr(errormsg, "\n\t")) != NULL) {
+ while ((s = strstr(g_FatalErrorMessage, "\n\t")) != NULL) {
s[0] = ' ';
s[1] = '\n';
}
@@ -99,7 +114,7 @@ OsVendorFatalError(const char *f, va_list args)
"%s\n\n"
"Please open %s for more information.\n",
MB_ICONERROR,
- errormsg,
+ g_FatalErrorMessage,
(g_pszLogFile ? g_pszLogFile : "the logfile"));
}