devdraw: fix stats for #i/winname (thanks jas)
This commit is contained in:
parent
0372073ee8
commit
90cbdce8ab
1 changed files with 8 additions and 10 deletions
|
@ -245,19 +245,17 @@ drawgen(Chan *c, char*, Dirtab*, int, int s, Dir *dp)
|
||||||
* Top level directory contains the name of the device.
|
* Top level directory contains the name of the device.
|
||||||
*/
|
*/
|
||||||
t = QID(c->qid);
|
t = QID(c->qid);
|
||||||
if(t == Qtopdir){
|
if(t == Qtopdir || t == Qwinname){
|
||||||
switch(s){
|
if(s == 1 || t == Qwinname){
|
||||||
case 0:
|
mkqid(&q, Qwinname, 0, QTFILE);
|
||||||
|
devdir(c, q, "winname", 0, eve, 0444, dp);
|
||||||
|
}
|
||||||
|
else if(s == 0){
|
||||||
mkqid(&q, Q2nd, 0, QTDIR);
|
mkqid(&q, Q2nd, 0, QTDIR);
|
||||||
devdir(c, q, "draw", 0, eve, 0555, dp);
|
devdir(c, q, "draw", 0, eve, 0555, dp);
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
mkqid(&q, Qwinname, 0, 0);
|
|
||||||
devdir(c, q, "winname", 0, eve, 0444, dp);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue