X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=sys%2Fsrc%2F9%2Fport%2Fsegment.c;h=e9e8959df8fa994735f684fea746a4fe37befaa3;hb=b450cb7e32ac9233d6d9225600feaf8b4a84301d;hp=987f984cc7cb60beb36ad2a13535e01c6505cb72;hpb=8ed25f24b7831eab394f14697766d55065b18822;p=plan9front.git diff --git a/sys/src/9/port/segment.c b/sys/src/9/port/segment.c index 987f984cc..e9e8959df 100644 --- a/sys/src/9/port/segment.c +++ b/sys/src/9/port/segment.c @@ -232,6 +232,9 @@ attachimage(int type, Chan *c, uintptr base, ulong len) { Image *i, **l; + c->flag &= ~CCACHE; + cclunk(c); + lock(&imagealloc); /* @@ -272,7 +275,6 @@ found: unlock(&imagealloc); if(i->c == nil){ i->c = c; - c->flag &= ~CCACHE; incref(c); } @@ -374,7 +376,7 @@ putimage(Image *i) ccloseq(c); /* does not block */ } -long +uintptr ibrk(uintptr addr, int seg) { Segment *s, *ns; @@ -602,9 +604,6 @@ segattach(Proc *p, ulong attr, char *name, uintptr va, uintptr len) if(va != 0 && va >= USTKTOP) error(Ebadarg); - validaddr((uintptr)name, 1, 0); - vmemchr(name, 0, ~0); - for(sno = 0; sno < NSEG; sno++) if(p->seg[sno] == nil && sno != ESEG) break;