diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-06-07 04:35:23 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-06-07 04:35:23 +0000 |
commit | 77481acf057de580f5ef3a2378ebc92264867feb (patch) | |
tree | aa01913c8c44c991d88e3bbaa1bffd037ccaea61 | |
parent | b932aaeafcb18deea79b4d19e84f527c5018141f (diff) | |
download | plan9front-77481acf057de580f5ef3a2378ebc92264867feb.tar.xz |
kbdfs: fix queue bug
-rw-r--r-- | sys/src/cmd/aux/kbdfs/kbdfs.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/src/cmd/aux/kbdfs/kbdfs.c b/sys/src/cmd/aux/kbdfs/kbdfs.c index fce22aa2a..2851b495f 100644 --- a/sys/src/cmd/aux/kbdfs/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs/kbdfs.c @@ -653,29 +653,29 @@ reqproc(void *aux) if(0){ case ASTR: p = s; - } else if(s == nil) - continue; - if((r = q) == nil) - continue; - if((q = q->aux) == nil) - qq = &q; + } - e = s + strlen(s); - if(p == s && r->fid->qid.path == Qkbd) - e++; /* send terminating \0 if its kbd file */ + while(s && q){ + r = q; + if((q = q->aux) == nil) + qq = &q; - n = e - p; - if(n > r->ifcall.count) - n = r->ifcall.count; + e = s + strlen(s); + if(p == s && r->fid->qid.path == Qkbd) + e++; /* send terminating \0 if its kbd file */ + n = e - p; + if(n > r->ifcall.count) + n = r->ifcall.count; - r->ofcall.count = n; - memmove(r->ofcall.data, p, n); - respond(r, nil); + r->ofcall.count = n; + memmove(r->ofcall.data, p, n); + respond(r, nil); - p += n; - if(p >= e){ - free(s); - s = nil; + p += n; + if(p >= e){ + free(s); + s = nil; + } } } } |