diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2016-03-01 21:37:05 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-03-09 16:12:25 +0000 |
commit | cdeaebad9889d81d2698b8a10fec5e55d8dec7a1 (patch) | |
tree | c9dd837ffe26a10d442f6bf5074e436a4beb1fa5 | |
parent | 24042b4e367803dd64f3fcdc1bef7b2bf36c4145 (diff) |
hw/xwin: Remove the long-broken -silent-dup-error option
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r-- | hw/xwin/InitOutput.c | 83 | ||||
-rw-r--r-- | hw/xwin/man/XWin.man | 4 | ||||
-rw-r--r-- | hw/xwin/winglobals.c | 1 | ||||
-rw-r--r-- | hw/xwin/winglobals.h | 1 | ||||
-rw-r--r-- | hw/xwin/winprocarg.c | 5 |
5 files changed, 0 insertions, 94 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index b6f258313..57e514faf 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -76,9 +76,6 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, * Function prototypes */ -static Bool - winCheckDisplayNumber(void); - void winLogCommandLine(int argc, char *argv[]); @@ -824,11 +821,6 @@ winUseMsg(void) "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n" "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n"); - ErrorF("-silent-dup-error\n" - "\tIf another instance of " EXECUTABLE_NAME - " with the same display number is running\n" - "\texit silently and don't display any error message.\n"); - ErrorF("-swcursor\n" "\tDisable the usage of the Windows cursor and use the X11 software\n" "\tcursor instead.\n"); @@ -918,14 +910,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) "Exiting.\n"); } - /* Check for duplicate invocation on same display number. */ - if (serverGeneration == 1 && !winCheckDisplayNumber()) { - if (g_fSilentDupError) - g_fSilentFatalError = TRUE; - FatalError("InitOutput - Duplicate invocation on display " - "number: %s. Exiting.\n", display); - } - #ifdef XWIN_XF86CONFIG /* Try to read the xorg.conf-style configuration file */ if (!winReadConfigfile()) @@ -1050,70 +1034,3 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) winDebug("InitOutput - Returning.\n"); #endif } - -/* - * winCheckDisplayNumber - Check if another instance of Cygwin/X is - * already running on the same display number. If no one exists, - * make a mutex to prevent new instances from running on the same display. - * - * return FALSE if the display number is already used. - */ - -static Bool -winCheckDisplayNumber(void) -{ - int nDisp; - HANDLE mutex; - char name[MAX_PATH]; - const char *pszPrefix = '\0'; - OSVERSIONINFO osvi = { 0 }; - - /* Check display range */ - nDisp = atoi(display); - if (nDisp < 0 || nDisp > 65535) { - ErrorF("winCheckDisplayNumber - Bad display number: %d\n", nDisp); - return FALSE; - } - - /* Set first character of mutex name to null */ - name[0] = '\0'; - - /* Get operating system version information */ - osvi.dwOSVersionInfoSize = sizeof(osvi); - GetVersionEx(&osvi); - - /* Want a mutex shared among all terminals on NT > 4.0 */ - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5) { - pszPrefix = "Global\\"; - } - - /* Setup Cygwin/X specific part of name */ - snprintf(name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp); - - /* Windows automatically releases the mutex when this process exits */ - mutex = CreateMutex(NULL, FALSE, name); - if (!mutex) { - LPVOID lpMsgBuf; - - /* Display a fancy error message */ - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL); - ErrorF("winCheckDisplayNumber - CreateMutex failed: %s\n", - (LPSTR) lpMsgBuf); - LocalFree(lpMsgBuf); - - return FALSE; - } - if (GetLastError() == ERROR_ALREADY_EXISTS) { - ErrorF("winCheckDisplayNumber - " - PROJECT_NAME " is already running on display %d\n", nDisp); - return FALSE; - } - - return TRUE; -} diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index d68ee2a41..50fdba2e0 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -305,10 +305,6 @@ and for \fIlevel\fP=3 detailed log information (including trace and debug output) is produced. Bigger values will yield a still more detailed debug output. .TP 8 -.B \-silent-dup-error -If another instance of \fIXWin\fP with the same display number is found running, -exit silently and don't display any error message. -.TP 8 .B "\-xkblayout \fIlayout\fP" .TP 8 .B "\-xkbmodel \fImodel\fP" diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index 1382c8972..66019b4b1 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -76,7 +76,6 @@ DWORD g_dwCurrentThreadID = 0; Bool g_fKeyboardHookLL = FALSE; Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; -Bool g_fSilentDupError = FALSE; Bool g_fNativeGl = TRUE; Bool g_fHostInTitle = TRUE; pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER; diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h index d7b813dbb..d143fb819 100644 --- a/hw/xwin/winglobals.h +++ b/hw/xwin/winglobals.h @@ -52,7 +52,6 @@ extern Bool g_fAuthEnabled; extern Bool g_fXdmcpEnabled; extern Bool g_fNoHelpMessageBox; -extern Bool g_fSilentDupError; extern Bool g_fNativeGl; extern Bool g_fHostInTitle; diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 73aa027d8..2bf656064 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -1078,11 +1078,6 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } - if (IS_OPTION("-silent-dup-error")) { - g_fSilentDupError = TRUE; - return 1; - } - if (IS_OPTION("-wgl")) { g_fNativeGl = TRUE; return 1; |