summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/libdraw/mouse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/src/libdraw/mouse.c b/sys/src/libdraw/mouse.c
index 49c5f278e..ceb93819d 100644
--- a/sys/src/libdraw/mouse.c
+++ b/sys/src/libdraw/mouse.c
@@ -52,6 +52,8 @@ _ioproc(void *arg)
n = read(mc->mfd, buf, sizeof buf);
if(n != 1+4*12){
yield(); /* if error is due to exiting, we'll exit here */
+ if(mc->mfd < 0)
+ break;
fprint(2, "mouse: bad count %d not 49: %r\n", n);
if(n<0 || ++nerr>10)
threadexits("read error");