~kris/9p

9hist

53ed9104284c7ad05b10d65d11455b30b31502f7 — David du Colombier 23 years ago e67857c
Plan 9 from Bell Labs 2003-03-29
2 files changed, 16 insertions(+), 1 deletions(-)

M port/dev.c
M port/devroot.c
M port/dev.c => port/dev.c +5 -1
@@ 203,7 203,11 @@ devwalk(Chan *c, Chan *nc, char **name, int nname, Dirtab *tab, int ntab, Devgen
			continue;
		}
		if(strcmp(n, "..") == 0){
			(*gen)(nc, nil, tab, ntab, DEVDOTDOT, &dir);
			if((*gen)(nc, nil, tab, ntab, DEVDOTDOT, &dir) != 1){
				print("devgen walk .. in dev%s %llux broken\n",
					devtab[nc->type]->name, nc->qid.path);
				error("broken devgen");
			}
			nc->qid = dir.qid;
			goto Accept;
		}

M port/devroot.c => port/devroot.c +11 -0
@@ 133,6 133,13 @@ rootgen(Chan *c, char *name, Dirtab*, int, int s, Dir *dp)
		}
		return devgen(c, name, bootlist.dir, bootlist.ndir, s, dp);
	default:
		if(s == DEVDOTDOT){
			if((int)c->qid.path < Qboot)
				devdir(c, (Qid){Qdir, 0, QTDIR}, "#/", 0, eve, 0555, dp);
			else
				devdir(c, (Qid){Qboot, 0, QTDIR}, "#/", 0, eve, 0555, dp);
			return 1;
		}
		if(s != 0)
			return -1;
		if((int)c->qid.path < Qboot){


@@ 144,6 151,10 @@ rootgen(Chan *c, char *name, Dirtab*, int, int s, Dir *dp)
		}
		if(t >= l->ndir)
			return -1;
if(t < 0){
print("rootgen %llud %d %d\n", c->qid.path, s, t);
panic("whoops");
}
		d = &l->dir[t];
		devdir(c, d->qid, d->name, d->length, eve, d->perm, dp);
		return 1;