--- XFree86-3.3.4.orig/xc/programs/xinit/xinit.c Sun Jun 27 12:32:26 1999 +++ XFree86-3.3.4/xc/programs/xinit/xinit.c Sun Aug 8 22:28:20 1999 @@ -596,30 +596,40 @@ serverpid = -1; break; } - /* - * kludge to avoid race with TCP, giving server time to - * set his socket options before we try to open it, - * either use the 15 second timeout, or await SIGUSR1. + + /* + * before we try the below kludge, see if we are already + * ready to connect. Fast CPUs with cached filesystems + * shouldn't have to wait 15 seconds. * - * If your machine is substantially slower than 15 seconds, - * you can easily adjust this value. + * pbrown@redhat.com - 06/08/1999 */ - alarm (15); + if (waitforserver() == 0) { + /* + * kludge to avoid race with TCP, giving server time to + * set his socket options before we try to open it, + * either use the 15 second timeout, or await SIGUSR1. + * + * If your machine is substantially slower than 15 seconds, + * you can easily adjust this value. + */ + alarm (15); #ifndef X_NOT_POSIX - sigsuspend(&old); - alarm (0); - sigprocmask(SIG_SETMASK, &old, NULL); + sigsuspend(&old); + alarm (0); + sigprocmask(SIG_SETMASK, &old, NULL); #else - sigpause (old); - alarm (0); - sigsetmask (old); + sigpause (old); + alarm (0); + sigsetmask (old); #endif - if (waitforserver() == 0) { - Error("unable to connect to X server\r\n"); - shutdown(); - serverpid = -1; + if (waitforserver() == 0) { + Error("unable to connect to X server\r\n"); + shutdown(); + serverpid = -1; + } } break; }