From c0b0f5db1df7926b91007ef4e33f5b0965a7312b Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 30 Jun 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-06-30 --- ip/il.c | 6 ++---- port/chan.c | 2 +- port/dev.c | 3 --- port/devbridge.c | 5 ----- port/log.c | 2 +- port/portfns.h | 2 +- 6 files changed, 5 insertions(+), 15 deletions(-) diff --git a/ip/il.c b/ip/il.c index 2946aedd2d8bc655b054e12833570f45738c89b5..296ae968ba2ed055e848881b444519827958ee7a 100644 --- a/ip/il.c +++ b/ip/il.c @@ -587,7 +587,7 @@ iliput(Proto *il, uchar*, Block *bp) if(new == nil){ qunlock(il); netlog(il->f, Logil, "il: bad newcall %I/%ud->%ud\n", raddr, sp, dp); - ilsendctl(nil, ih, Ilclose, 0, nhgetl(ih->ilid), 0); + ilsendctl(s, ih, Ilclose, 0, nhgetl(ih->ilid), 0); goto raise; } @@ -985,11 +985,9 @@ ilsendctl(Conv *ipc, Ilhdr *inih, int type, ulong id, ulong ack, int ilspec) if(ilcksum) hnputs(ih->ilsum, ptclcsum(bp, IL_IPSIZE, IL_HDRSIZE)); - if(ipc){ - netlog(ipc->p->f, Logilmsg, "ctl(%s id %d ack %d %d->%d)\n", + netlog(ipc->p->f, Logilmsg, "ctl(%s id %d ack %d %d->%d)\n", iltype[ih->iltype], nhgetl(ih->ilid), nhgetl(ih->ilack), nhgets(ih->ilsrc), nhgets(ih->ildst)); - } ipoput(ipc->p->f, bp, 0, ttl); } diff --git a/port/chan.c b/port/chan.c index 9dd9f991a072bddfdc8d97f3fa7565949f8e1338..3b030658e73c9dc9096470062c304567c30eff05 100644 --- a/port/chan.c +++ b/port/chan.c @@ -159,7 +159,7 @@ addelem(Cname *n, char *s) } i = strlen(s); - if(n->len+1+i+1 < n->alen){ + if(n->len+1+i+1 > n->alen){ a = n->len+1+i+1 + CNAMESLOP; t = smalloc(a); memmove(t, n->s, n->len+1); diff --git a/port/dev.c b/port/dev.c index 0d6f69735a065dac326498b163639abffc819f8f..f69e45645185b26dfe3c161950cf5ba5c9bba9f8 100644 --- a/port/dev.c +++ b/port/dev.c @@ -72,7 +72,6 @@ devattach(int tc, char *spec) c->qid = (Qid){CHDIR, 0}; c->type = devno(tc, 0); sprint(buf, "#%C%s", tc, spec==nil? "" : spec); - free(c->name); c->name = newcname(buf); return c; } @@ -100,8 +99,6 @@ devclone(Chan *c, Chan *nc) nc->mchan = c->mchan; nc->mqid = c->mqid; nc->mcp = c->mcp; - if(c->name) - incref(c->name); return nc; } diff --git a/port/devbridge.c b/port/devbridge.c index b526ac5a55b3ce0e5d0c4fc675a7fd28e6eab193..2946f5ad204bec417324899d621fab7153f4584f 100644 --- a/port/devbridge.c +++ b/port/devbridge.c @@ -179,8 +179,6 @@ bridgeattach(char* spec) static int bridgewalk(Chan *c, char *name) { - Path *op; - if(strcmp(name, "..") == 0){ switch(TYPE(c->qid)){ case Qtopdir: @@ -193,9 +191,6 @@ bridgewalk(Chan *c, char *name) default: panic("bridgewalk %lux", c->qid.path); } - op = c->path; - c->path = ptenter(&syspt, op, name); - decref(op); return 1; } diff --git a/port/log.c b/port/log.c index 0d68028b4779994b54624fb35653f4f2ffe1f6e5..ed40c0f6b3ecc1475820e82d4fe30df9cfc89d84 100644 --- a/port/log.c +++ b/port/log.c @@ -108,7 +108,7 @@ logread(Log *alog, void *a, ulong, long n) char* logctl(Log *alog, int argc, char *argv[], Logflag *flags) { - int i, n, set; + int i, set; Logflag *fp; if(argc < 2) diff --git a/port/portfns.h b/port/portfns.h index 02b64fdfc4d7cb150614c61cf11551298b1627fc..4ab6393a6e8365b0c604d32a8db65350ab81b428 100644 --- a/port/portfns.h +++ b/port/portfns.h @@ -117,7 +117,7 @@ long hostdomainwrite(char*, int); long hostownerwrite(char*, int); void iallocinit(void); Block* iallocb(int); -void iallocsumary(void); +void iallocsummary(void); long ibrk(ulong, int); void ilock(Lock*); void iunlock(Lock*);