aboutsummaryrefslogtreecommitdiff
path: root/src/libventi/rpc.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-14 19:33:42 +0000
committerrsc <devnull@localhost>2005-02-14 19:33:42 +0000
commit5ddc97fc3e63fb0bdf14ec3583afbec765f1a45d (patch)
tree02619869c53875b78dd9aafefe50c6d6f079811b /src/libventi/rpc.c
parent8ee6ad4d96bdb1f56cece8c11e75e5491ccc4020 (diff)
downloadplan9port-5ddc97fc3e63fb0bdf14ec3583afbec765f1a45d.tar.gz
plan9port-5ddc97fc3e63fb0bdf14ec3583afbec765f1a45d.tar.bz2
plan9port-5ddc97fc3e63fb0bdf14ec3583afbec765f1a45d.zip
disable logging
Diffstat (limited to 'src/libventi/rpc.c')
-rw-r--r--src/libventi/rpc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/libventi/rpc.c b/src/libventi/rpc.c
index a3914530..0cd9410a 100644
--- a/src/libventi/rpc.c
+++ b/src/libventi/rpc.c
@@ -36,7 +36,7 @@ vtrpc(VtConn *z, Packet *p)
{
int i;
uchar tag, buf[2], *top;
- Rwait *r;
+ Rwait *r, *rr;
/* must malloc because stack could be private */
r = vtmallocz(sizeof(Rwait));
@@ -86,16 +86,15 @@ vtrpc(VtConn *z, Packet *p)
muxrpc(z, p);
}
z->muxer = 0;
- /* if there is anyone else sleeping, wake them to mux */
- if(z->nsleep){
- for(i=0; i<256; i++)
- if(z->wait[i] != nil && ((Rwait*)z->wait[i])->sleeping)
- break;
- if(i==256)
- fprint(2, "libventi: nsleep botch\n");
- else
- rwakeup(&((Rwait*)z->wait[i])->r);
- }
+ /* if there is anyone else sleeping, wake first unfinished to mux */
+ if(z->nsleep)
+ for(i=0; i<256; i++){
+ rr = z->wait[i];
+ if(rr && rr->sleeping && !rr->done){
+ rwakeup(&rr->r);
+ break;
+ }
+ }
}
p = r->p;