From 1da847509300fe382aac0e7e4807c07f5822f11a Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 7 Jun 2011 05:02:12 +0000 Subject: [PATCH] kbdfs: simplfy --- sys/src/cmd/aux/kbdfs/kbdfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/aux/kbdfs/kbdfs.c b/sys/src/cmd/aux/kbdfs/kbdfs.c index 2851b495f..4584769b6 100644 --- a/sys/src/cmd/aux/kbdfs/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs/kbdfs.c @@ -617,15 +617,18 @@ reqproc(void *aux) qq = &q; ac = aux; + a[AREQ].op = CHANRCV; a[AREQ].c = ac[0]; /* chan(Req*) */ a[AREQ].v = &r; + a[ASTR].c = ac[1]; /* chan(char*) */ a[ASTR].v = &s; + a[AEND].op = CHANEND; for(;;){ - a[AREQ].op = CHANRCV; - a[ASTR].op = (q != nil && s == nil) ? CHANRCV : CHANNOP; + a[ASTR].op = s ? CHANNOP : CHANRCV; + switch(alt(a)){ case AREQ: if(r->ifcall.type == Tflush){