~kris/9p

9hist

fa37873d63b3d389e934dbb9c4a665e9f3a310d8 — David du Colombier 26 years ago f8deea5
Plan 9 from Bell Labs 2000-03-11
1 files changed, 9 insertions(+), 3 deletions(-)

M boot/boot.c
M boot/boot.c => boot/boot.c +9 -3
@@ 127,12 127,18 @@ boot(int argc, char *argv[])
	rp = getenv("rootdir");
	if(rp == nil)
		rp = rootdir;
	if(strncmp(rp, "/root", 5) != 0){
	if(bind(rp, "/", MAFTER|MCREATE) < 0){
		if(strncmp(rp, "/root", 5) == 0){
			fprint(2, "boot: couldn't bind $rootdir=%s to root: %r\n", rp);
			fatal("second bind /");
		}
		snprint(rootbuf, sizeof rootbuf, "/root/%s", rp);
		rp = rootbuf;
		if(bind(rp, "/", MAFTER|MCREATE) < 0){
			fprint(2, "boot: couldn't bind $rootdir=%s to root: %r\n", rp);
			fatal("second bind /");
		}
	}
	if(bind(rp, "/", MAFTER|MCREATE) < 0)
		fatal("second bind /");
	close(fd);
	setenv("rootdir", rp);