WaitForInput before trying to xf86EloGetPacket. #14109

Followup to 72408c2404.

This patch isn't perfect yet, usage of O_NONBLOCK would be preferred and some
better error handling for incomplete packages, but at least it's less broken
than without this patch.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>

X.Org Bug 14109 <http://bugs.freedesktop.org/show_bug.cgi?id=14109>
This commit is contained in:
William M. Brack
2008-06-17 09:00:32 +09:30
committed by Peter Hutterer
parent 929b723521
commit 086e9d2056

View File

@@ -807,10 +807,13 @@ xf86EloReadInput(LocalDevicePtr local)
/*
* Try to get a packet.
*/
while (xf86EloGetPacket(priv->packet_buf,
while (xf86WaitForInput(local->fd, ELO_MAX_WAIT) > 0) {
if(xf86EloGetPacket(priv->packet_buf,
&priv->packet_buf_p,
&priv->checksum,
local->fd) == Success) {
local->fd) != Success)
break;
/*
* Process only ELO_TOUCHs here.
*/