summaryrefslogtreecommitdiff
path: root/xserver/Xext
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-12-15 11:31:10 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-12-15 11:31:10 +0000
commit711e4a3fe5a55562a9289d5de44672e82f6a2285 (patch)
treed1d31ffa284e7ec6a97e67082e7e1222e8610da2 /xserver/Xext
parent0078550bb8d0157602e73a6961648013591d837d (diff)
Avoid timeouts of ULONG_MAX milliseconds. Stops the X server from crashing
with "select returned EINVAL" messages. ok matthieu@
Diffstat (limited to 'xserver/Xext')
-rw-r--r--xserver/Xext/sync.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/xserver/Xext/sync.c b/xserver/Xext/sync.c
index 9b4d0a474..1e3d43ee6 100644
--- a/xserver/Xext/sync.c
+++ b/xserver/Xext/sync.c
@@ -2686,27 +2686,24 @@ IdleTimeBlockHandler(pointer pCounter, struct timeval **wt, pointer LastSelectMa
* If we've been idle more than it, and someone wants to know about
* that level-triggered, schedule an immediate wakeup.
*/
- unsigned long timeout = -1;
if (XSyncValueLessThan(idle, *greater)) {
XSyncValue value;
Bool overflow;
XSyncValueSubtract(&value, *greater, idle, &overflow);
- timeout = min(timeout, XSyncValueLow32(value));
+ AdjustWaitForDelay(wt, XSyncValueLow32(value));
}
else {
for (list = counter->sync.pTriglist; list;
list = list->next) {
trig = list->pTrigger;
if (trig->CheckTrigger(trig, old_idle)) {
- timeout = min(timeout, 0);
+ AdjustWaitForDelay(wt, 0);
break;
}
}
}
-
- AdjustWaitForDelay(wt, timeout);
}
counter->value = old_idle; /* pop */