Bug fixes from the Valgrind oracle.

This commit is contained in:
rsc 2003-12-09 06:37:26 +00:00
parent ceb0477083
commit e95a70884b
3 changed files with 4 additions and 1 deletions

View file

@ -11,6 +11,7 @@ static int
mygetdents(int fd, struct dirent *buf, int n) mygetdents(int fd, struct dirent *buf, int n)
{ {
off_t off; off_t off;
int nn;
off = p9seek(fd, 0, 1); off = p9seek(fd, 0, 1);
nn = getdirentries(fd, (void*)buf, n, &off); nn = getdirentries(fd, (void*)buf, n, &off);

View file

@ -199,7 +199,7 @@ _fsgetfid(Fsys *fs)
qlock(&fs->lk); qlock(&fs->lk);
if(fs->freefid == nil){ if(fs->freefid == nil){
f = malloc(sizeof(Fid)*Fidchunk); f = mallocz(sizeof(Fid)*Fidchunk, 1);
if(f == nil){ if(f == nil){
qunlock(&fs->lk); qunlock(&fs->lk);
return nil; return nil;

View file

@ -81,6 +81,7 @@ muxrpc(Mux *mux, void *tx)
} }
r2 = mux->wait[tag]; r2 = mux->wait[tag];
r2->p = p; r2->p = p;
dequeue(mux, r2);
rwakeup(&r2->r); rwakeup(&r2->r);
} }
mux->muxer = 0; mux->muxer = 0;
@ -131,6 +132,7 @@ gettag(Mux *mux, Muxrpc *r)
w = realloc(mux->wait, mw*sizeof(w[0])); w = realloc(mux->wait, mw*sizeof(w[0]));
if(w == nil) if(w == nil)
return -1; return -1;
memset(w+mux->mwait, 0, (mw-mux->mwait)*sizeof(w[0]));
mux->wait = w; mux->wait = w;
mux->freetag = mux->mwait; mux->freetag = mux->mwait;
mux->mwait = mw; mux->mwait = mw;