plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit a28c0548f4a9c621c3fce2d0bcf66727694deffa
parent 2d70c581f4346401c61e6bb25b3e31b001f05e0a
Author: rsc <devnull@localhost>
Date:   Wed, 13 Jul 2005 10:51:30 +0000

better errors

Diffstat:
Msrc/libmux/mux.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/libmux/mux.c b/src/libmux/mux.c @@ -35,8 +35,10 @@ muxrpc(Mux *mux, void *tx) /* must malloc because stack could be private */ r = mallocz(sizeof(Muxrpc), 1); - if(r == nil) + if(r == nil){ + werrstr("mallocz: %r"); return nil; + } r->r.l = &mux->lk; /* assign the tag, add selves to response queue */ @@ -48,6 +50,8 @@ muxrpc(Mux *mux, void *tx) /* actually send the packet */ if(tag < 0 || mux->settag(mux, tx, tag) < 0 || _muxsend(mux, tx) < 0){ + werrstr("settag/send tag %d: %r", tag); + fprint(2, "%r\n"); qlock(&mux->lk); dequeue(mux, r); puttag(mux, r); @@ -105,6 +109,8 @@ muxrpc(Mux *mux, void *tx) p = r->p; puttag(mux, r); qunlock(&mux->lk); + if(p == nil) + werrstr("unexpected eof"); return p; }