diff options
author | William M. Brack <wbrack@mmm.com.hk> | 2008-06-17 09:00:32 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-17 09:02:01 +0930 |
commit | 086e9d2056c8fbb5138b54b95f4559acf8f0f158 (patch) | |
tree | fdcfe9564c7d820c42a8c2038e00dc893f0d2388 | |
parent | 929b72352110b8d5dcdf74bec21694d8de9f948c (diff) |
WaitForInput before trying to xf86EloGetPacket. #14109
Followup to 72408c2404246b9cb4698bd45be439be8ced3c23.
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>
-rw-r--r-- | src/xf86Elo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/xf86Elo.c b/src/xf86Elo.c index c107927..ef8cb2f 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -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. */ |