From 5a3c4b079611100d195a2e8b7e203da409901830 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 17 Apr 1991 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1991-04-17 --- port/stnoether.c | 6 +++--- port/sysfile.c | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/port/stnoether.c b/port/stnoether.c index ee9972ba8d39c3ae0d15a1c68ac72816255f488f..eff320897bcf3775a507319ebc7338af57d910c8 100644 --- a/port/stnoether.c +++ b/port/stnoether.c @@ -118,9 +118,9 @@ noetherbad(Noifc *ifc, Block *bp, int circuit) */ eh = (Etherpkt*)bp->rptr; nh = (Nohdr*)eh->data; - print("bad %.2ux%.2ux%.2ux%.2ux%.2ux%.2ux c %d m %d f %d\n", +/* print("bad %.2ux%.2ux%.2ux%.2ux%.2ux%.2ux c %d m %d f %d\n", eh->s[0], eh->s[1], eh->s[2], eh->s[3], eh->s[4], - eh->s[5], circuit, nh->mid, nh->flag); + eh->s[5], circuit, nh->mid, nh->flag); /**/ if(nh->flag & NO_RESET) goto out; @@ -134,7 +134,7 @@ noetherbad(Noifc *ifc, Block *bp, int circuit) /* * craft an error reply */ - print("sending reset\n"); +/* print("sending reset\n"); /**/ nbp = allocb(60); nbp->flags |= S_DELIM; nbp->wptr = nbp->rptr + 60; diff --git a/port/sysfile.c b/port/sysfile.c index bd4f3d15c93a5900c29c79705d1ddff09ba8dcac..8a0805fd85e3da13c3d11513341a4556d0340ef6 100644 --- a/port/sysfile.c +++ b/port/sysfile.c @@ -227,8 +227,10 @@ sysread(ulong *arg) c = fdtochan(arg[0], OREAD); validaddr(arg[1], arg[2], 1); qlock(&c->rdl); + qlock(&c->wrl); /* BUG BUG BUG */ if(waserror()){ qunlock(&c->rdl); + qunlock(&c->wrl); /* BUG BUG BUG */ nexterror(); } n = arg[2]; @@ -243,6 +245,7 @@ sysread(ulong *arg) n = (*devtab[c->type].read)(c, (void*)arg[1], n, c->offset); c->offset += n; qunlock(&c->rdl); + qunlock(&c->wrl); /* BUG BUG BUG */ return n; } @@ -254,8 +257,10 @@ syswrite(ulong *arg) c = fdtochan(arg[0], OWRITE); validaddr(arg[1], arg[2], 0); + qlock(&c->rdl); /* BUG BUG BUG */ qlock(&c->wrl); if(waserror()){ + qunlock(&c->rdl); /* BUG BUG BUG */ qunlock(&c->wrl); nexterror(); } @@ -263,6 +268,7 @@ syswrite(ulong *arg) error(Eisdir); n = (*devtab[c->type].write)(c, (void*)arg[1], arg[2], c->offset); c->offset += n; + qunlock(&c->rdl); /* BUG BUG BUG */ qunlock(&c->wrl); return n; }