From bc923c191c00127c51cb5248b271787cf938e8c8 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 8 Sep 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-09-08 --- pc/devarch.c | 2 +- port/devsdp.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pc/devarch.c b/pc/devarch.c index bd00951ab2c66f7a5b34d364de44e4372f55ed4f..aea6f0ba6c3a9836be0008490418dc4c88e3ac3f 100644 --- a/pc/devarch.c +++ b/pc/devarch.c @@ -91,7 +91,7 @@ ioalloc(int port, int size, int align, char *tag) return -1; } } else { - // see if the space clashes with previously alllocated ports + // see if the space clashes with previously allocated ports for(l = &iomap.m; *l; l = &(*l)->next){ m = *l; if(m->end <= port) diff --git a/port/devsdp.c b/port/devsdp.c index ee0d35b963f649058f6a45c6508ee11ff8b61fda..8f698d009c09ff01c9219157e20b51a89dc54ea1 100644 --- a/port/devsdp.c +++ b/port/devsdp.c @@ -179,6 +179,13 @@ static Logflag logflags[] = static Dirtab *dirtab[MaxQ]; static Sdp sdptab[Nfs]; +static char *convstatename[] = { + [CInit] "Init", + [COpening] "Opening", + [COpen] "Open", + [CClosing] "Closing", + [CClosed] "Closed", +}; static int sdpgen(Chan *c, Dirtab*, int, int s, Dir *dp); static Conv *sdpclone(Sdp *sdp); @@ -318,6 +325,7 @@ sdpopen(Chan* ch, int omode) if(strcmp(up->user, c->owner) != 0 || (perm & c->perm) != perm) error(Eperm); c->ref++; +print(c->ref = %d\n", c->ref); if(TYPE(ch->qid) == Qdata) c->dataopen++; qunlock(c); @@ -359,7 +367,7 @@ sdpclose(Chan* ch) if(c->dataopen == 0) wakeup(&c->in.controlready); } - +print("close c->ref = %d\n", c->ref); if(c->ref == 0) { switch(c->state) { default: @@ -703,7 +711,7 @@ static void convsetstate(Conv *c, int state) { -print("convsetstate %d -> %d\n", c->state, state); +print("convsetstate %s -> %s\n", convstatename[c->state], convstatename[state]); switch(state) { default: