--- ./xserver/hw/xwin/save_winclipboardthread.c 2005-07-04 23:10:43.000000000 +0100 +++ ./xserver/hw/xwin/winclipboardthread.c 2007-05-08 08:14:38.000000000 +0100 @@ -322,7 +322,7 @@ FD_SET (fdMessageQueue, &fdsRead); #else tvTimeout.tv_sec = 0; - tvTimeout.tv_usec = 100; + tvTimeout.tv_usec = 100000; #endif /* Wait for a Windows event or an X event */ @@ -358,7 +358,7 @@ } /* Branch on which descriptor became active */ - if (FD_ISSET (iConnectionNumber, &fdsRead)) + if (iReturn > 0 && FD_ISSET (iConnectionNumber, &fdsRead)) { /* Process X events */ /* Exit when we see that server is shutting down */ --- ./xserver/hw/xwin/save_winclipboardwndproc.c 2006-08-18 16:16:50.000000000 +0100 +++ ./xserver/hw/xwin/winclipboardwndproc.c 2007-05-05 06:32:39.000000000 +0100 @@ -36,6 +36,7 @@ #include "winclipboard.h" extern void winFixClipboardChain(); +extern void CheckConnections(); /* @@ -76,8 +77,9 @@ winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay, Bool fUseUnicode, int iTimeoutSec) { - int iConnNumber; + fd_set fdsRead; struct timeval tv; + int iConnNumber; int iReturn; DWORD dwStopTime = (GetTickCount () / 1000) + iTimeoutSec; @@ -90,8 +92,6 @@ /* Loop for X events */ while (1) { - fd_set fdsRead; - /* Setup the file descriptor set */ FD_ZERO (&fdsRead); FD_SET (iConnNumber, &fdsRead); @@ -110,7 +110,13 @@ NULL, /* No write mask */ NULL, /* No exception mask */ &tv); /* No timeout */ - if (iReturn <= 0) + if (iReturn == 0) + { + CheckConnections(); + ErrorF ("winProcessXEventsTimeout - Call to select () failed: timeout. Bailing.\n"); + break; + } + else if (iReturn < 0) { ErrorF ("winProcessXEventsTimeout - Call to select () failed: %d. " "Bailing.\n", iReturn);