Browse Source

Plan 9 from Bell Labs 2008-08-15

David du Colombier 12 years ago
parent
commit
e8744a3bff

+ 5 - 3
dist/replica/_plan9.db

@@ -8857,7 +8857,7 @@ sys/src/ape/lib/ap/plan9/sleep.c - 664 sys sys 1014921985 222
 sys/src/ape/lib/ap/plan9/sqrt.c - 664 sys sys 1014921985 759
 sys/src/ape/lib/ap/plan9/stat.c - 664 sys sys 1014921984 284
 sys/src/ape/lib/ap/plan9/sys9.h - 664 sys sys 1048644336 4251
-sys/src/ape/lib/ap/plan9/system.c - 664 sys sys 1121977156 598
+sys/src/ape/lib/ap/plan9/system.c - 664 sys sys 1218757755 598
 sys/src/ape/lib/ap/plan9/tcgetattr.c - 664 sys sys 1038237528 3070
 sys/src/ape/lib/ap/plan9/time.c - 664 sys sys 1048644336 380
 sys/src/ape/lib/ap/plan9/times.c - 664 sys sys 1014921984 730
@@ -13288,7 +13288,7 @@ sys/src/cmd/ratfs/mkfile - 664 sys sys 1016943965 142
 sys/src/cmd/ratfs/proto.c - 664 sys sys 1016943965 8528
 sys/src/cmd/ratfs/ratfs.h - 664 sys sys 1016943965 2743
 sys/src/cmd/rc - 20000000775 sys sys 1071884773 0
-sys/src/cmd/rc/code.c - 664 sys sys 1182898057 8218
+sys/src/cmd/rc/code.c - 664 sys sys 1218739076 8353
 sys/src/cmd/rc/compiling.on.unix - 664 sys sys 1071884773 37638
 sys/src/cmd/rc/exec.c - 664 sys sys 1216774327 16980
 sys/src/cmd/rc/exec.h - 664 sys sys 1174851874 2828
@@ -13307,7 +13307,7 @@ sys/src/cmd/rc/pcmd.c - 664 sys sys 1100894077 2681
 sys/src/cmd/rc/pfnc.c - 664 sys sys 1100894077 1320
 sys/src/cmd/rc/plan9.c - 664 sys sys 1215383577 10084
 sys/src/cmd/rc/rc.h - 664 sys sys 1182898644 3326
-sys/src/cmd/rc/simple.c - 664 sys sys 1215383579 9205
+sys/src/cmd/rc/simple.c - 664 sys sys 1218738983 9201
 sys/src/cmd/rc/subr.c - 664 sys sys 1182919084 1200
 sys/src/cmd/rc/syn.y - 664 sys sys 944961083 3128
 sys/src/cmd/rc/trap.c - 664 sys sys 1174851077 878
@@ -15884,3 +15884,5 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/rc - 775 sys sys 1218770618 145866
+386/lib/ape/libap.a - 664 sys sys 1218770631 822090

+ 5 - 5
dist/replica/plan9.db

@@ -386,7 +386,7 @@
 386/bin/pump - 775 sys sys 1218252949 62504
 386/bin/pwd - 775 sys sys 1148500685 36932
 386/bin/ramfs - 775 sys sys 1209184388 89491
-386/bin/rc - 775 sys sys 1216785116 145872
+386/bin/rc - 775 sys sys 1218770618 145866
 386/bin/rdbfs - 775 sys sys 1210392910 173349
 386/bin/read - 775 sys sys 1168402347 58283
 386/bin/replica - 20000000775 sys sys 1018321168 0
@@ -555,7 +555,7 @@
 386/lib - 20000000775 sys sys 1016826328 0
 386/lib/ape - 20000000775 sys sys 1070519112 0
 386/lib/ape/lib9.a - 664 sys sys 1205611022 8766
-386/lib/ape/libap.a - 664 sys sys 1212377617 822090
+386/lib/ape/libap.a - 664 sys sys 1218770631 822090
 386/lib/ape/libbsd.a - 664 sys sys 1212377620 183900
 386/lib/ape/libdraw.a - 664 sys sys 1212377632 631580
 386/lib/ape/libfmt.a - 664 sys sys 1212377636 156706
@@ -8857,7 +8857,7 @@ sys/src/ape/lib/ap/plan9/sleep.c - 664 sys sys 1014921985 222
 sys/src/ape/lib/ap/plan9/sqrt.c - 664 sys sys 1014921985 759
 sys/src/ape/lib/ap/plan9/stat.c - 664 sys sys 1014921984 284
 sys/src/ape/lib/ap/plan9/sys9.h - 664 sys sys 1048644336 4251
-sys/src/ape/lib/ap/plan9/system.c - 664 sys sys 1121977156 598
+sys/src/ape/lib/ap/plan9/system.c - 664 sys sys 1218757755 598
 sys/src/ape/lib/ap/plan9/tcgetattr.c - 664 sys sys 1038237528 3070
 sys/src/ape/lib/ap/plan9/time.c - 664 sys sys 1048644336 380
 sys/src/ape/lib/ap/plan9/times.c - 664 sys sys 1014921984 730
@@ -13288,7 +13288,7 @@ sys/src/cmd/ratfs/mkfile - 664 sys sys 1016943965 142
 sys/src/cmd/ratfs/proto.c - 664 sys sys 1016943965 8528
 sys/src/cmd/ratfs/ratfs.h - 664 sys sys 1016943965 2743
 sys/src/cmd/rc - 20000000775 sys sys 1071884773 0
-sys/src/cmd/rc/code.c - 664 sys sys 1182898057 8218
+sys/src/cmd/rc/code.c - 664 sys sys 1218739076 8353
 sys/src/cmd/rc/compiling.on.unix - 664 sys sys 1071884773 37638
 sys/src/cmd/rc/exec.c - 664 sys sys 1216774327 16980
 sys/src/cmd/rc/exec.h - 664 sys sys 1174851874 2828
@@ -13307,7 +13307,7 @@ sys/src/cmd/rc/pcmd.c - 664 sys sys 1100894077 2681
 sys/src/cmd/rc/pfnc.c - 664 sys sys 1100894077 1320
 sys/src/cmd/rc/plan9.c - 664 sys sys 1215383577 10084
 sys/src/cmd/rc/rc.h - 664 sys sys 1182898644 3326
-sys/src/cmd/rc/simple.c - 664 sys sys 1215383579 9205
+sys/src/cmd/rc/simple.c - 664 sys sys 1218738983 9201
 sys/src/cmd/rc/subr.c - 664 sys sys 1182919084 1200
 sys/src/cmd/rc/syn.y - 664 sys sys 944961083 3128
 sys/src/cmd/rc/trap.c - 664 sys sys 1174851077 878

+ 5 - 0
dist/replica/plan9.log

@@ -20170,3 +20170,8 @@
 1218508204 1 c sys/src/boot/pc/load.c - 664 sys sys 1218507506 11060
 1218661204 0 c sys/src/boot/pc/bootp.c - 664 sys sys 1218660611 12678
 1218661204 1 c sys/src/boot/pc/load.c - 664 sys sys 1218660619 11499
+1218738604 0 c sys/src/cmd/rc/simple.c - 664 sys sys 1218738983 9201
+1218740404 0 c sys/src/cmd/rc/code.c - 664 sys sys 1218739076 8353
+1218758405 0 c sys/src/ape/lib/ap/plan9/system.c - 664 sys sys 1218757755 598
+1218771004 0 c 386/bin/rc - 775 sys sys 1218770618 145866
+1218771004 1 c 386/lib/ape/libap.a - 664 sys sys 1218770631 822090

+ 1 - 1
sys/src/ape/lib/ap/plan9/system.c

@@ -11,7 +11,7 @@ system(const char *s)
 	pid_t pid;
 	char cmd[30], *oty;
 
-	oty = getenv("objtype");
+	oty = getenv("cputype");
 	if(!oty)
 		return -1;
 	if(!s)

+ 7 - 7
sys/src/cmd/rc/code.c

@@ -331,25 +331,25 @@ outcode(tree *t, int eflag)
 	case '=':
 		tt = t;
 		for(;t && t->type=='=';t = c2);
-		if(t){
+		if(t){					/* var=value cmd */
 			for(t = tt;t->type=='=';t = c2){
 				emitf(Xmark);
 				outcode(c1, eflag);
 				emitf(Xmark);
 				outcode(c0, eflag);
-				emitf(Xlocal);
+				emitf(Xlocal);		/* push var for cmd */
 			}
-			t = tt;
-			outcode(c2, eflag);
-			for(;t->type=='=';t = c2) emitf(Xunlocal);
+			outcode(t, eflag);		/* gen. code for cmd */
+			for(t = tt; t->type == '='; t = c2)
+				emitf(Xunlocal);	/* pop var */
 		}
-		else{
+		else{					/* var=value */
 			for(t = tt;t;t = c2){
 				emitf(Xmark);
 				outcode(c1, eflag);
 				emitf(Xmark);
 				outcode(c0, eflag);
-				emitf(Xassign);
+				emitf(Xassign);	/* set var permanently */
 			}
 		}
 		t = tt;	/* so tests below will work */

+ 1 - 1
sys/src/cmd/rc/simple.c

@@ -130,7 +130,7 @@ execfunc(var *func)
 	starval = runq->argv->words;
 	runq->argv->words = 0;
 	poplist();
-	start(func->fn, func->pc, (struct var *)0);
+	start(func->fn, func->pc, runq->local);
 	runq->local = newvar(strdup("*"), runq->local);
 	runq->local->val = starval;
 	runq->local->changed = 1;