It's nice to avoid X server crashes (by not passing negative values to
select(3)).

For more information:
http://article.gmane.org/gmane.comp.freedesktop.xorg.devel/37388

Signed-off-by: Felipe Contreras <[email protected]>
---
 src/sna/sna_accel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4838371..ce6da7d 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -15978,6 +15978,9 @@ void sna_accel_block_handler(struct sna *sna, struct 
timeval **tv)
                     __FUNCTION__, sna->timer_active));
 
                timeout = sna->timer_expire[0] - TIME;
+               if (timeout < 0)
+                       timeout = 0;
+
                DBG(("%s: flush timer expires in %d [%d]\n",
                     __FUNCTION__, timeout, sna->timer_expire[0]));
 
-- 
1.8.4-fc

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to