tBug fixes from the Valgrind oracle. - 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 e95a70884b2eb361e0e879a91e5b46aea4e1d633
 (DIR) parent ceb04770830a7610a5a9a21aa96a4ba4cece2a5d
 (HTM) Author: rsc <devnull@localhost>
       Date:   Tue,  9 Dec 2003 06:37:26 +0000
       
       Bug fixes from the Valgrind oracle.
       
       Diffstat:
         M src/lib9/dirread.c                  |       1 +
         M src/libfs/fs.c                      |       2 +-
         M src/libmux/mux.c                    |       2 ++
       
       3 files changed, 4 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/src/lib9/dirread.c b/src/lib9/dirread.c
       t@@ -11,6 +11,7 @@ static int
        mygetdents(int fd, struct dirent *buf, int n)
        {
                off_t off;
       +        int nn;
        
                off = p9seek(fd, 0, 1);
                nn = getdirentries(fd, (void*)buf, n, &off);
 (DIR) diff --git a/src/libfs/fs.c b/src/libfs/fs.c
       t@@ -199,7 +199,7 @@ _fsgetfid(Fsys *fs)
        
                qlock(&fs->lk);
                if(fs->freefid == nil){
       -                f = malloc(sizeof(Fid)*Fidchunk);
       +                f = mallocz(sizeof(Fid)*Fidchunk, 1);
                        if(f == nil){
                                qunlock(&fs->lk);
                                return nil;
 (DIR) diff --git a/src/libmux/mux.c b/src/libmux/mux.c
       t@@ -81,6 +81,7 @@ muxrpc(Mux *mux, void *tx)
                                }
                                r2 = mux->wait[tag];
                                r2->p = p;
       +                        dequeue(mux, r2);
                                rwakeup(&r2->r);
                        }
                        mux->muxer = 0;
       t@@ -131,6 +132,7 @@ gettag(Mux *mux, Muxrpc *r)
                                        w = realloc(mux->wait, mw*sizeof(w[0]));
                                        if(w == nil)
                                                return -1;
       +                                memset(w+mux->mwait, 0, (mw-mux->mwait)*sizeof(w[0]));
                                        mux->wait = w;
                                        mux->freetag = mux->mwait;
                                        mux->mwait = mw;