mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtexec: fix a case on linux where an infinite loop could occur.
This commit is contained in:
parent
2fc37b0f45
commit
90baa59dc1
1 changed files with 14 additions and 0 deletions
|
@ -1295,6 +1295,20 @@ main (
|
||||||
COPYBITS(allactivefdsG, readfds);
|
COPYBITS(allactivefdsG, readfds);
|
||||||
COPYBITS(allactivefdsG, exceptfds);
|
COPYBITS(allactivefdsG, exceptfds);
|
||||||
|
|
||||||
|
#if defined(linux)
|
||||||
|
/* JET 9/1/98 - linux select will actually modify the timeout struct -
|
||||||
|
* if a select exits early then the timeout struct will contain the
|
||||||
|
* amount remaining. When this gets to 0,0, an infinite loop
|
||||||
|
* will occur. So... setup the timeouts each iteration.
|
||||||
|
*/
|
||||||
|
|
||||||
|
timeoutShort.tv_sec = 0; /* in quick rediscovery mode */
|
||||||
|
timeoutShort.tv_usec = SHORT_SELECT_TIMEOUT;
|
||||||
|
timeoutLong.tv_sec = 86400; /* don't thrash on rediscovery */
|
||||||
|
timeoutLong.tv_usec = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (rediscoverSigCldG || rediscoverUrgentSigG) {
|
if (rediscoverSigCldG || rediscoverUrgentSigG) {
|
||||||
nfound =select(MAXSOCKS, FD_SET_CAST(&readfds), FD_SET_CAST(NULL),
|
nfound =select(MAXSOCKS, FD_SET_CAST(&readfds), FD_SET_CAST(NULL),
|
||||||
FD_SET_CAST(&exceptfds), &timeoutShort);
|
FD_SET_CAST(&exceptfds), &timeoutShort);
|
||||||
|
|
Loading…
Reference in a new issue