summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2013-06-14 20:43:12 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2013-06-15 12:37:06 +0100
commit2217c8ab8c6804e839b1f3df2fa90f54692537a8 (patch)
tree69d6697d08489a1a16fc742d13db5c207a4f97fc
parent53cf43b275964a84ed2a3fb9c05a77521e07d074 (diff)
Remove XOpenDisplay() retry code
Remove XOpenDisplay() retry code. This isn't a sensible thing for the application to be doing, and XWin server needs to retry much more than just XOpenDisplay().
-rw-r--r--xwinclip.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/xwinclip.c b/xwinclip.c
index dab755c..8720476 100644
--- a/xwinclip.c
+++ b/xwinclip.c
@@ -66,9 +66,6 @@
#define WINDOW_TITLE "xwinclip"
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
-#define WIN_CONNECT_RETRIES 3
-#define WIN_CONNECT_DELAY 4
-
/*
* Local variables
*/
@@ -148,13 +145,9 @@ ClipboardProc(Bool fUnicodeSupport, char *pszDisplay)
int iMaxDescriptor;
Display *pDisplay = NULL;
Window iWindow = None;
- int iRetries;
int iSelectError;
Bool fShutdown = FALSE;
- /* Initialize retry count */
- iRetries = 0;
-
/* Set error handler */
XSetErrorHandler(ClipboardErrorHandler);
g_ClipboardProcThread = pthread_self();
@@ -168,26 +161,10 @@ ClipboardProc(Bool fUnicodeSupport, char *pszDisplay)
}
/* Open the X display */
- do
- {
- pDisplay = XOpenDisplay (pszDisplay);
- if (pDisplay == NULL)
- {
- winError ("Could not open display, try: %d, sleeping: %d\n",
- iRetries + 1, WIN_CONNECT_DELAY);
- ++iRetries;
- sleep (WIN_CONNECT_DELAY);
- continue;
- }
- else
- break;
- }
- while (pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
-
- /* Make sure that the display opened */
+ pDisplay = XOpenDisplay (pszDisplay);
if (pDisplay == NULL)
{
- winError ("Failed opening the display, giving up\n");
+ winError ("Could not open display\n");
goto ClipboardProc_Done;
}