]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/port/segment.c
devmnt: deal with partial response for Tversion request in mntversion()
[plan9front.git] / sys / src / 9 / port / segment.c
index 987f984cc7cb60beb36ad2a13535e01c6505cb72..e9e8959df8fa994735f684fea746a4fe37befaa3 100644 (file)
@@ -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;