Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!mcvax!ukc!acorn!john From: john@acorn.UUCP (John Bowler) Newsgroups: comp.windows.x Subject: Re: SUN select error Summary: select() is sometimes passed a negative timeout Message-ID: <522@acorn.UUCP> Date: 21 Oct 88 15:15:57 GMT Article-I.D.: acorn.522 References: <16520@shemp.CS.UCLA.EDU> Organization: Acorn Computers Limited, Cambridge, UK Lines: 44 In article <16520@shemp.CS.UCLA.EDU>, tek@CS.UCLA.EDU writes: > Every now and then the server stops responding for a while and gives > me a whole bunch (like a screen full) of these error messages: > > WaitForSomething(): select: errno=22 > > Usually, this happens just after (within a second) of moving the > mouse. Eventually, the server recovers and all is fine. After a while > though this gets annoying. The problem also occurs in BSD43 based servers typically when the ``logo'' screen saver is switched on and the timeout is relatively short - colour servers are particularly prone. It is caused by ``timeout'' remaining negative in the following piece of code in WaitFor() (from WaitFor.c) /*-------- WaitFor.c -- Waitfor() --------*/ if (timeout < 0) /* may be forced by AutoResetServer() */ { if (clientsDoomed) { *nnew = *nready = 0; break; } if (timeout < intervalCount) { /*-- SaveScreens can take a very long time!! --*/ SaveScreens(SCREEN_SAVER_ON, ScreenSaverActive); if (intervalCount) intervalCount -= ScreenSaverInterval; else intervalCount = -(ScreenSaverInterval + ScreenSaverTime); } timeout -= intervalCount; /*-- timeout may still be <0 fix by adding the following line:- --*/ if (timeout < 0) /* BUG FIX */ { /* BUG FIX */ intervalCount = timeout-ScreenSaverInterval; /* BUG FIX */ timeout = 0; /* BUG FIX */ } /* BUG FIX */ } /*------------------------------------------*/ John Bowler (jbowler@acorn.co.uk)