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.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/xorg-server/hw/xwin/winerror.c b/xorg-server/hw/xwin/winerror.c
index 6645469fc..ed9ee296e 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);
@@ -65,6 +84,7 @@ 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)
{
@@ -78,9 +98,11 @@ OsVendorFatalError(const char *f, va_list args)
}
LogClose(EXIT_ERR_ABORT);
- winMessageBoxF("A fatal error has occurred and " PROJECT_NAME
- " will now exit.\n" "Please open %s for more information.\n",
- MB_ICONERROR, (g_pszLogFile ? g_pszLogFile : "the logfile"));
+ winMessageBoxF (
+ "Error: %s\n\n"\
+ PROJECT_NAME " will now exit.\n\n" \
+ "Please open %s for more information.\n",
+ MB_ICONERROR, g_FatalErrorMessage, (g_pszLogFile?g_pszLogFile:"the logfile"));
}
/*