tbetter errors - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit a28c0548f4a9c621c3fce2d0bcf66727694deffa
 (DIR) parent 2d70c581f4346401c61e6bb25b3e31b001f05e0a
 (HTM) Author: rsc <devnull@localhost>
       Date:   Wed, 13 Jul 2005 10:51:30 +0000
       
       better errors
       
       Diffstat:
         M src/libmux/mux.c                    |       8 +++++++-
       
       1 file changed, 7 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/src/libmux/mux.c b/src/libmux/mux.c
       t@@ -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 */
       t@@ -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);
       t@@ -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;
        }