Permit multiple opens of #m/mousein. Simplifies debugging, and allows for possibilities like bluetooth mice or trackpads without disabling usb mouse. Reference: /n/sources/patch/applied/mousein-non-excl Date: Tue Dec 11 15:40:09 CET 2012 Signed-off-by: miller@hamnavoe.com --- /sys/src/9/port/devmouse.c Tue Dec 11 15:35:56 2012 +++ /sys/src/9/port/devmouse.c Tue Dec 11 15:35:53 2012 @@ -44,7 +44,6 @@ Ref; QLock; int open; - int inopen; int acceleration; int maxacc; Mousestate queue[16]; /* circular buffer of click events */ @@ -202,13 +201,6 @@ case Qmousein: if(!iseve()) error(Eperm); - lock(&mouse); - if(mouse.inopen){ - unlock(&mouse); - error(Einuse); - } - mouse.inopen = 1; - unlock(&mouse); break; default: incref(&mouse); @@ -231,14 +223,11 @@ mouseclose(Chan *c) { if((c->qid.type&QTDIR)==0 && (c->flag&COPEN)){ + if(c->qid.path == Qmousein) + return; lock(&mouse); if(c->qid.path == Qmouse) mouse.open = 0; - else if(c->qid.path == Qmousein){ - mouse.inopen = 0; - unlock(&mouse); - return; - } if(--mouse.ref == 0){ cursoroff(1); curs = arrow; --- /sys/man/3/mouse Tue Dec 11 15:35:59 2012 +++ /sys/man/3/mouse Tue Dec 11 15:35:57 2012 @@ -62,7 +62,7 @@ file. The .B mousein -file, which is exclusive-use and may be opened +file, which may be opened only by the host owner, is intended for controlling devices, such as USB mice, that are managed by user-level software. Each event should consist of