kbdfs: fix queue bug
This commit is contained in:
parent
b932aaeafc
commit
77481acf05
1 changed files with 19 additions and 19 deletions
|
@ -653,29 +653,29 @@ reqproc(void *aux)
|
||||||
if(0){
|
if(0){
|
||||||
case ASTR:
|
case ASTR:
|
||||||
p = s;
|
p = s;
|
||||||
} else if(s == nil)
|
}
|
||||||
continue;
|
|
||||||
if((r = q) == nil)
|
|
||||||
continue;
|
|
||||||
if((q = q->aux) == nil)
|
|
||||||
qq = &q;
|
|
||||||
|
|
||||||
e = s + strlen(s);
|
while(s && q){
|
||||||
if(p == s && r->fid->qid.path == Qkbd)
|
r = q;
|
||||||
e++; /* send terminating \0 if its kbd file */
|
if((q = q->aux) == nil)
|
||||||
|
qq = &q;
|
||||||
|
|
||||||
n = e - p;
|
e = s + strlen(s);
|
||||||
if(n > r->ifcall.count)
|
if(p == s && r->fid->qid.path == Qkbd)
|
||||||
n = r->ifcall.count;
|
e++; /* send terminating \0 if its kbd file */
|
||||||
|
n = e - p;
|
||||||
|
if(n > r->ifcall.count)
|
||||||
|
n = r->ifcall.count;
|
||||||
|
|
||||||
r->ofcall.count = n;
|
r->ofcall.count = n;
|
||||||
memmove(r->ofcall.data, p, n);
|
memmove(r->ofcall.data, p, n);
|
||||||
respond(r, nil);
|
respond(r, nil);
|
||||||
|
|
||||||
p += n;
|
p += n;
|
||||||
if(p >= e){
|
if(p >= e){
|
||||||
free(s);
|
free(s);
|
||||||
s = nil;
|
s = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue