diff options
-rw-r--r-- | src/lib9/dirread.c | 1 | ||||
-rw-r--r-- | src/libfs/fs.c | 2 | ||||
-rw-r--r-- | src/libmux/mux.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/lib9/dirread.c b/src/lib9/dirread.c index 4105e878..db80c357 100644 --- a/src/lib9/dirread.c +++ b/src/lib9/dirread.c @@ -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); diff --git a/src/libfs/fs.c b/src/libfs/fs.c index c06e19d8..b34df340 100644 --- a/src/libfs/fs.c +++ b/src/libfs/fs.c @@ -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; diff --git a/src/libmux/mux.c b/src/libmux/mux.c index 7a21b444..b1fdeb03 100644 --- a/src/libmux/mux.c +++ b/src/libmux/mux.c @@ -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; @@ -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; |