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>
This commit is contained in:
parent
24042b4e36
commit
cdeaebad98
|
@ -76,9 +76,6 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
|
||||||
* Function prototypes
|
* Function prototypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Bool
|
|
||||||
winCheckDisplayNumber(void);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
winLogCommandLine(int argc, char *argv[]);
|
winLogCommandLine(int argc, char *argv[]);
|
||||||
|
|
||||||
|
@ -824,11 +821,6 @@ winUseMsg(void)
|
||||||
"\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n"
|
"\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n"
|
||||||
"\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\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"
|
ErrorF("-swcursor\n"
|
||||||
"\tDisable the usage of the Windows cursor and use the X11 software\n"
|
"\tDisable the usage of the Windows cursor and use the X11 software\n"
|
||||||
"\tcursor instead.\n");
|
"\tcursor instead.\n");
|
||||||
|
@ -918,14 +910,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
|
||||||
"Exiting.\n");
|
"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
|
#ifdef XWIN_XF86CONFIG
|
||||||
/* Try to read the xorg.conf-style configuration file */
|
/* Try to read the xorg.conf-style configuration file */
|
||||||
if (!winReadConfigfile())
|
if (!winReadConfigfile())
|
||||||
|
@ -1050,70 +1034,3 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
|
||||||
winDebug("InitOutput - Returning.\n");
|
winDebug("InitOutput - Returning.\n");
|
||||||
#endif
|
#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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -305,10 +305,6 @@ and for \fIlevel\fP=3 detailed log
|
||||||
information (including trace and debug output) is produced. Bigger
|
information (including trace and debug output) is produced. Bigger
|
||||||
values will yield a still more detailed debug output.
|
values will yield a still more detailed debug output.
|
||||||
.TP 8
|
.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"
|
.B "\-xkblayout \fIlayout\fP"
|
||||||
.TP 8
|
.TP 8
|
||||||
.B "\-xkbmodel \fImodel\fP"
|
.B "\-xkbmodel \fImodel\fP"
|
||||||
|
|
|
@ -76,7 +76,6 @@ DWORD g_dwCurrentThreadID = 0;
|
||||||
Bool g_fKeyboardHookLL = FALSE;
|
Bool g_fKeyboardHookLL = FALSE;
|
||||||
Bool g_fNoHelpMessageBox = FALSE;
|
Bool g_fNoHelpMessageBox = FALSE;
|
||||||
Bool g_fSoftwareCursor = FALSE;
|
Bool g_fSoftwareCursor = FALSE;
|
||||||
Bool g_fSilentDupError = FALSE;
|
|
||||||
Bool g_fNativeGl = TRUE;
|
Bool g_fNativeGl = TRUE;
|
||||||
Bool g_fHostInTitle = TRUE;
|
Bool g_fHostInTitle = TRUE;
|
||||||
pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
|
@ -52,7 +52,6 @@ extern Bool g_fAuthEnabled;
|
||||||
extern Bool g_fXdmcpEnabled;
|
extern Bool g_fXdmcpEnabled;
|
||||||
|
|
||||||
extern Bool g_fNoHelpMessageBox;
|
extern Bool g_fNoHelpMessageBox;
|
||||||
extern Bool g_fSilentDupError;
|
|
||||||
extern Bool g_fNativeGl;
|
extern Bool g_fNativeGl;
|
||||||
extern Bool g_fHostInTitle;
|
extern Bool g_fHostInTitle;
|
||||||
|
|
||||||
|
|
|
@ -1078,11 +1078,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_OPTION("-silent-dup-error")) {
|
|
||||||
g_fSilentDupError = TRUE;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_OPTION("-wgl")) {
|
if (IS_OPTION("-wgl")) {
|
||||||
g_fNativeGl = TRUE;
|
g_fNativeGl = TRUE;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue