aboutsummaryrefslogtreecommitdiff
path: root/src/libventi
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-04-21 19:43:09 +0000
committerrsc <devnull@localhost>2007-04-21 19:43:09 +0000
commit6ce75e8dc072178f410db9a6ae7d70a5101e640c (patch)
treeac6c88a436c6eaaf22b45a0dcc4443a96e4331aa /src/libventi
parent35a80291f7c4efbb34e784528682ef02bce09d72 (diff)
downloadplan9port-6ce75e8dc072178f410db9a6ae7d70a5101e640c.tar.gz
plan9port-6ce75e8dc072178f410db9a6ae7d70a5101e640c.tar.bz2
plan9port-6ce75e8dc072178f410db9a6ae7d70a5101e640c.zip
sync with plan 9
Diffstat (limited to 'src/libventi')
-rw-r--r--src/libventi/cache.c8
-rw-r--r--src/libventi/file.c2
-rw-r--r--src/libventi/hangup.c6
-rw-r--r--src/libventi/log.c1
-rw-r--r--src/libventi/packet.c12
5 files changed, 9 insertions, 20 deletions
diff --git a/src/libventi/cache.c b/src/libventi/cache.c
index 809e340f..65e0e8c4 100644
--- a/src/libventi/cache.c
+++ b/src/libventi/cache.c
@@ -158,20 +158,14 @@ cachecheck(VtCache *c)
else if(b->addr != NilBlock)
refed++;
}
-if(c->nheap + refed != c->nblock){
-fprint(2, "cachecheck: nheap %d refed %d nblocks %d\n", c->nheap, refed, c->nblock);
-/*vtcachedump(c); */
-}
assert(c->nheap + refed == c->nblock);
refed = 0;
for(i = 0; i < c->nblock; i++){
b = &c->block[i];
if(b->ref){
-if(1)fprint(2, "a=%ud %V ref=%d pc=%#lux\n", b->addr, b->score, b->ref, (ulong)b->pc);
refed++;
}
}
-if(refed > 0)fprint(2, "cachecheck: in used %d\n", refed);
}
static int
@@ -353,7 +347,7 @@ vtcacheallocblock(VtCache *c, int type)
qlock(&b->lk);
b->nlock = 1;
- b->pc = getcallerpc(&b);
+ b->pc = getcallerpc(&c);
return b;
}
diff --git a/src/libventi/file.c b/src/libventi/file.c
index 6604ef67..29b414f6 100644
--- a/src/libventi/file.c
+++ b/src/libventi/file.c
@@ -1041,7 +1041,7 @@ filewrite1(VtFile *f, void *data, long count, vlong offset)
vtfilegetentry(f, &e);
if(count < 0 || offset < 0){
- werrstr("bad offset or count");
+ werrstr("vtfilewrite: bad offset or count");
return -1;
}
diff --git a/src/libventi/hangup.c b/src/libventi/hangup.c
index 23075864..365baf1d 100644
--- a/src/libventi/hangup.c
+++ b/src/libventi/hangup.c
@@ -1,5 +1,7 @@
#include <u.h>
+#ifdef PLAN9PORT
#include <sys/socket.h>
+#endif
#include <libc.h>
#include <venti.h>
#include "queue.h"
@@ -9,9 +11,11 @@ vthangup(VtConn *z)
{
qlock(&z->lk);
z->state = VtStateClosed;
- /* try to make the read in vtsendproc fail */
+#ifdef PLAN9PORT
+ /* try to make the read in vtrecvproc fail */
shutdown(SHUT_WR, z->infd);
shutdown(SHUT_WR, z->outfd);
+#endif
if(z->infd >= 0)
close(z->infd);
if(z->outfd >= 0 && z->outfd != z->infd)
diff --git a/src/libventi/log.c b/src/libventi/log.c
index 7d0accde..16535599 100644
--- a/src/libventi/log.c
+++ b/src/libventi/log.c
@@ -50,7 +50,6 @@ vtlognames(int *pn)
a = (char*)(s+nname);
e = (char*)s+nname*sizeof(char*)+size;
- size = 0;
nname = 0;
for(i=0; i<nelem(vl.hash); i++)
for(l=vl.hash[i]; l; l=l->next){
diff --git a/src/libventi/packet.c b/src/libventi/packet.c
index 99479399..2c3dcd77 100644
--- a/src/libventi/packet.c
+++ b/src/libventi/packet.c
@@ -75,7 +75,7 @@ static char EPacketSize[] = "bad packet size";
static char EPacketOffset[] = "bad packet offset";
static char EBadSize[] = "bad size";
-#if 0
+#ifdef NOTDEF
static void checkpacket(Packet*);
#endif
@@ -126,8 +126,6 @@ packetalloc(void)
p->next = nil;
p->pc = getcallerpc((char*)&p+8); /* might not work, but fine */
-/*if(0)fprint(2, "packetalloc %p from %08lux %08lux %08lux\n", p, *((uint*)&p+2), *((uint*)&p+3), *((uint*)&p+4)); */
-
NOTFREE(p);
return p;
}
@@ -137,8 +135,6 @@ packetfree(Packet *p)
{
Frag *f, *ff;
-/*if(1)fprint(2, "packetfree %p from %08lux\n", p, getcallerpc(&p)); */
-
if(p == nil)
return;
@@ -216,7 +212,6 @@ packetsplit(Packet *p, int n)
Packet *pp;
Frag *f, *ff;
- if(0) fprint(2, "packetsplit %p %d\n", p, n);
NOTFREE(p);
if(n < 0 || n > p->size) {
werrstr(EPacketSize);
@@ -265,7 +260,6 @@ packetsplit(Packet *p, int n)
int
packetconsume(Packet *p, uchar *buf, int n)
{
- if(0) fprint(2, "packetconsume %p %d\n", p, n);
NOTFREE(p);
if(buf && packetcopy(p, buf, 0, n) < 0)
return -1;
@@ -277,7 +271,6 @@ packettrim(Packet *p, int offset, int n)
{
Frag *f, *ff;
- if(0) fprint(2, "packettrim %p %d %d\n", p, offset, n);
NOTFREE(p);
if(offset < 0 || offset > p->size) {
werrstr(EPacketOffset);
@@ -377,7 +370,6 @@ packettrailer(Packet *p, int n)
Mem *m;
Frag *f;
- if(0) fprint(2, "packettrailer %p %d\n", p, n);
NOTFREE(p);
if(n <= 0 || n > MaxFragSize) {
werrstr(EPacketSize);
@@ -1009,7 +1001,7 @@ memtail(Mem *m, uchar *wp, int n)
return 0;
}
-#if 0
+#ifdef NOTDEF
static void
checkpacket(Packet *p)
{