From: Chris Wilson Date: Mon, 11 Nov 2013 10:47:24 +0000 (+0000) Subject: intel-virtual-output: Avoid the infinite loop around XPending X-Git-Tag: 2.99.906~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e81a9cbd68344450a6e82130edfef21dd04ec43;p=platform%2Fupstream%2Fxf86-video-intel.git intel-virtual-output: Avoid the infinite loop around XPending XPending() reports if there are any events pending and does not perform any dequeuing itself - ergo for a remote display while (XPending()) ; becomes an infinite loop should there be an event pending. References: https://bugs.freedesktop.org/show_bug.cgi?id=71345 Signed-off-by: Chris Wilson --- diff --git a/tools/virtual.c b/tools/virtual.c index 48fe347..4da8309 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -1357,9 +1357,7 @@ static int clone_paint(struct clone *c) DisplayString(c->dst.dpy), c->dst.name, (long)c->dst.serial, (long)LastKnownRequestProcessed(c->dst.dpy))); if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) { - while (XPending(c->dst.dpy)) - ; - + XPending(c->dst.dpy); if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) { c->dst.display->skip_clone++; return EAGAIN;