From: Felipe Contreras Subject: [PATCH] sna: avoid negative timeouts Date: Thu, 3 Oct 2013 01:29:29 -0500 Message-ID: <1380781769-7805-1-git-send-email-felipe.contreras@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: xorg-devel-bounces+gcfxd-xorg-devel=m.gmane.org-go0+a7rfsptAfugRpC6u6w@public.gmane.org Errors-To: xorg-devel-bounces+gcfxd-xorg-devel=m.gmane.org-go0+a7rfsptAfugRpC6u6w@public.gmane.org To: xorg-devel-go0+a7rfsptAfugRpC6u6w@public.gmane.org Cc: intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Felipe Contreras List-Id: intel-gfx@lists.freedesktop.org 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 --- 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 _______________________________________________ xorg-devel-go0+a7rfsptAfugRpC6u6w@public.gmane.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel