little bug fixes
diff --git a/src/libventi/cache.c b/src/libventi/cache.c index 6ed61a0..fb0be90 100644 --- a/src/libventi/cache.c +++ b/src/libventi/cache.c
@@ -262,7 +262,8 @@ */ if(c->nheap == 0){ vtcachedump(c); - sysfatal("vtcachebumpblock: no free blocks in vtCache"); + fprint(2, "vtcachebumpblock: no free blocks in vtCache"); + abort(); } b = c->heap[0]; heapdel(b);
diff --git a/src/libventi/client.c b/src/libventi/client.c index a58b208..772b430 100644 --- a/src/libventi/client.c +++ b/src/libventi/client.c
@@ -64,6 +64,9 @@ { VtFcall tx, rx; + if(memcmp(score, vtzeroscore, VtScoreSize) == 0) + return packetalloc(); + memset(&tx, 0, sizeof tx); tx.type = VtTread; tx.dtype = type; @@ -107,6 +110,10 @@ { VtFcall tx, rx; + if(packetsize(p) == 0){ + memmove(score, vtzeroscore, VtScoreSize); + return 0; + } tx.type = VtTwrite; tx.dtype = type; tx.data = p;
diff --git a/src/libventi/fcall.c b/src/libventi/fcall.c index ace8962..9e2fefa 100644 --- a/src/libventi/fcall.c +++ b/src/libventi/fcall.c
@@ -226,5 +226,5 @@ vtfree(f->auth); f->auth = nil; packetfree(f->data); - f->auth = nil; + f->data = nil; }
diff --git a/src/libventi/file.c b/src/libventi/file.c index 0b48707..dac53a5 100644 --- a/src/libventi/file.c +++ b/src/libventi/file.c
@@ -98,6 +98,9 @@ assert(mode == VtOREAD || p->mode == VtORDWR); p->ref++; qunlock(&p->lk); + }else{ + assert(b->addr != NilBlock); + r->local = 1; } memmove(r->score, b->score, VtScoreSize); r->offset = offset; @@ -119,7 +122,6 @@ b = vtcachelocal(c, addr, VtDirType); if(b == nil) return nil; - r = vtfilealloc(c, b, nil, 0, mode); vtblockput(b); return r; @@ -1151,7 +1153,7 @@ ret = flushblock(f->c, nil, e.score, e.psize/VtScoreSize, e.dsize/VtEntrySize, e.type); - if(!ret){ + if(ret < 0){ vtblockput(b); return -1; }