aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-12-09 06:37:26 +0000
committerrsc <devnull@localhost>2003-12-09 06:37:26 +0000
commite95a70884b2eb361e0e879a91e5b46aea4e1d633 (patch)
treee55b66f6f86f9f49735b35dbc6578f6768dd0f8b /src
parentceb04770830a7610a5a9a21aa96a4ba4cece2a5d (diff)
downloadplan9port-e95a70884b2eb361e0e879a91e5b46aea4e1d633.tar.gz
plan9port-e95a70884b2eb361e0e879a91e5b46aea4e1d633.tar.bz2
plan9port-e95a70884b2eb361e0e879a91e5b46aea4e1d633.zip
Bug fixes from the Valgrind oracle.
Diffstat (limited to 'src')
-rw-r--r--src/lib9/dirread.c1
-rw-r--r--src/libfs/fs.c2
-rw-r--r--src/libmux/mux.c2
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;