M port/stnoether.c => port/stnoether.c +3 -3
@@ 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;
M port/sysfile.c => port/sysfile.c +6 -0
@@ 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;
}