M ip/ipmux.c => ip/ipmux.c +5 -0
@@ 717,6 717,11 @@ yes:
c = mux->conv;
mux = mux->yes;
}
+ if(c != nil){
+ qpass(c->rq, bp);
+ return;
+ }
+ runlock(f);
nomatch:
/* doesn't match any filter, hand it to the specific protocol handler */
ip = (Iphdr*)bp->rp;
M port/devcons.c => port/devcons.c +1 -1
@@ 817,7 817,7 @@ conswrite(Chan *c, void *va, long n, vlong off)
if(buf[0]<'0' || '9'<buf[0])
error(Ebadarg);
fd = strtoul(buf, 0, 0);
- swc = fdtochan(fd, -1, 1, 0);
+ swc = fdtochan(fd, -1, 1, 1);
setswapchan(swc);
break;
M port/swap.c => port/swap.c +3 -2
@@ 330,10 330,11 @@ void
setswapchan(Chan *c)
{
if(swapimage.c) {
- if(swapalloc.free != conf.nswap)
+ if(swapalloc.free != conf.nswap){
+ cclose(c);
error(Einuse);
+ }
cclose(swapimage.c);
}
- incref(c);
swapimage.c = c;
}
M port/sysfile.c => port/sysfile.c +7 -1
@@ 479,7 479,11 @@ sseek(ulong *arg)
ulong u[2];
} o;
- c = fdtochan(arg[1], -1, 1, 0);
+ c = fdtochan(arg[1], -1, 1, 1);
+ if(waserror()){
+ cclose(c);
+ nexterror();
+ }
if(c->qid.path & CHDIR)
error(Eisdir);
@@ 510,6 514,8 @@ sseek(ulong *arg)
break;
}
*(vlong*)arg[0] = off;
+ cclose(c);
+ poperror();
}
long