shithub: riscv

Download patch

ref: 90036b9991198e709330c884b7497fff29e7a58d
parent: a72a7c1cc2ba721fe0871cd69951ae8ac526487e
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sat Apr 27 00:21:08 EDT 2013

libdraw: avoid printing error on closemouse()

--- a/sys/src/libdraw/mouse.c
+++ b/sys/src/libdraw/mouse.c
@@ -52,6 +52,8 @@
 		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");
--