Browse Source

Plan 9 from Bell Labs 2005-12-24

David du Colombier 15 years ago
parent
commit
e332d8ac11

+ 5 - 5
dist/replica/_plan9.db

@@ -296,7 +296,7 @@
 386/bin/ip/httpfile - 775 sys sys 1134389869 283607
 386/bin/ip/imap4d - 775 sys sys 1132506861 237689
 386/bin/ip/ipconfig - 775 sys sys 1132506861 137882
-386/bin/ip/ping - 775 sys sys 1132544402 76457
+386/bin/ip/ping - 775 sys sys 1135360964 76456
 386/bin/ip/ppp - 775 sys sys 1130594755 219988
 386/bin/ip/pppoe - 775 sys sys 1130594755 77580
 386/bin/ip/pptp - 775 sys sys 1130594755 126690
@@ -449,7 +449,7 @@
 386/bin/upas/fs - 775 sys sys 1134389879 334032
 386/bin/upas/isspam - 775 sys sys 1064598349 38
 386/bin/upas/list - 775 sys sys 1135101638 82799
-386/bin/upas/marshal - 775 sys sys 1132506879 132971
+386/bin/upas/marshal - 775 sys sys 1135360965 133019
 386/bin/upas/ml - 775 sys sys 1132506879 123917
 386/bin/upas/mlmgr - 775 sys sys 1132506880 104539
 386/bin/upas/mlowner - 775 sys sys 1130594799 92131
@@ -11988,7 +11988,7 @@ sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1015013077 2481
 sys/src/cmd/ip/ipconfig.c - 664 sys sys 1126103921 34865
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1131110598 1243
-sys/src/cmd/ip/ping.c - 664 sys sys 1132503333 5642
+sys/src/cmd/ip/ping.c - 664 sys sys 1135352233 5611
 sys/src/cmd/ip/ppp - 20000000775 sys sys 988249980 0
 sys/src/cmd/ip/ppp/block.c - 664 sys sys 1015090266 5353
 sys/src/cmd/ip/ppp/compress.c - 664 sys sys 1072729513 11774
@@ -13357,7 +13357,7 @@ sys/src/cmd/upas/fs/readdir.c - 664 sys sys 944961331 203
 sys/src/cmd/upas/fs/strtotm.c - 664 sys sys 1041137528 1904
 sys/src/cmd/upas/fs/tester.c - 664 sys sys 985037420 1418
 sys/src/cmd/upas/marshal - 20000000775 sys sys 1015009721 0
-sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1124027454 32708
+sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1135352267 32852
 sys/src/cmd/upas/marshal/mkfile - 664 sys sys 1047490298 235
 sys/src/cmd/upas/misc - 20000000775 sys sys 944961318 0
 sys/src/cmd/upas/misc/gone.fishing - 664 sys sys 944961318 313
@@ -14600,7 +14600,7 @@ sys/src/libmach/vcodas.c - 664 sys sys 1131289385 10258
 sys/src/libmach/vdb.c - 664 sys sys 1131289381 22264
 sys/src/libmach/vobj.c - 664 sys sys 1091732625 2206
 sys/src/libmemdraw - 20000000775 sys sys 985020762 0
-sys/src/libmemdraw/alloc.c - 664 sys sys 1046640198 3234
+sys/src/libmemdraw/alloc.c - 664 sys sys 1135394719 3332
 sys/src/libmemdraw/alpha.hoc - 664 sys sys 944961741 220
 sys/src/libmemdraw/arc.c - 664 sys sys 1039752932 2608
 sys/src/libmemdraw/arctest.c - 664 sys sys 1045502219 865

+ 5 - 5
dist/replica/plan9.db

@@ -296,7 +296,7 @@
 386/bin/ip/httpfile - 775 sys sys 1134389869 283607
 386/bin/ip/imap4d - 775 sys sys 1132506861 237689
 386/bin/ip/ipconfig - 775 sys sys 1132506861 137882
-386/bin/ip/ping - 775 sys sys 1132544402 76457
+386/bin/ip/ping - 775 sys sys 1135360964 76456
 386/bin/ip/ppp - 775 sys sys 1130594755 219988
 386/bin/ip/pppoe - 775 sys sys 1130594755 77580
 386/bin/ip/pptp - 775 sys sys 1130594755 126690
@@ -449,7 +449,7 @@
 386/bin/upas/fs - 775 sys sys 1134389879 334032
 386/bin/upas/isspam - 775 sys sys 1064598349 38
 386/bin/upas/list - 775 sys sys 1135101638 82799
-386/bin/upas/marshal - 775 sys sys 1132506879 132971
+386/bin/upas/marshal - 775 sys sys 1135360965 133019
 386/bin/upas/ml - 775 sys sys 1132506879 123917
 386/bin/upas/mlmgr - 775 sys sys 1132506880 104539
 386/bin/upas/mlowner - 775 sys sys 1130594799 92131
@@ -11988,7 +11988,7 @@ sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1015013077 2481
 sys/src/cmd/ip/ipconfig.c - 664 sys sys 1126103921 34865
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1131110598 1243
-sys/src/cmd/ip/ping.c - 664 sys sys 1132503333 5642
+sys/src/cmd/ip/ping.c - 664 sys sys 1135352233 5611
 sys/src/cmd/ip/ppp - 20000000775 sys sys 988249980 0
 sys/src/cmd/ip/ppp/block.c - 664 sys sys 1015090266 5353
 sys/src/cmd/ip/ppp/compress.c - 664 sys sys 1072729513 11774
@@ -13357,7 +13357,7 @@ sys/src/cmd/upas/fs/readdir.c - 664 sys sys 944961331 203
 sys/src/cmd/upas/fs/strtotm.c - 664 sys sys 1041137528 1904
 sys/src/cmd/upas/fs/tester.c - 664 sys sys 985037420 1418
 sys/src/cmd/upas/marshal - 20000000775 sys sys 1015009721 0
-sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1124027454 32708
+sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1135352267 32852
 sys/src/cmd/upas/marshal/mkfile - 664 sys sys 1047490298 235
 sys/src/cmd/upas/misc - 20000000775 sys sys 944961318 0
 sys/src/cmd/upas/misc/gone.fishing - 664 sys sys 944961318 313
@@ -14600,7 +14600,7 @@ sys/src/libmach/vcodas.c - 664 sys sys 1131289385 10258
 sys/src/libmach/vdb.c - 664 sys sys 1131289381 22264
 sys/src/libmach/vobj.c - 664 sys sys 1091732625 2206
 sys/src/libmemdraw - 20000000775 sys sys 985020762 0
-sys/src/libmemdraw/alloc.c - 664 sys sys 1046640198 3234
+sys/src/libmemdraw/alloc.c - 664 sys sys 1135394719 3332
 sys/src/libmemdraw/alpha.hoc - 664 sys sys 944961741 220
 sys/src/libmemdraw/arc.c - 664 sys sys 1039752932 2608
 sys/src/libmemdraw/arctest.c - 664 sys sys 1045502219 865

+ 6 - 0
dist/replica/plan9.log

@@ -23666,3 +23666,9 @@
 1135274406 0 c 386/bin/aux/vga - 775 sys sys 1135273452 333829
 1135274406 1 c sys/src/cmd/aux/vga/vesa.c - 664 sys sys 1135273443 21668
 1135283419 0 c 386/bin/aux/vga - 775 sys sys 1135283089 333900
+1135353633 0 c sys/src/cmd/ip/ping.c - 664 sys sys 1135352233 5611
+1135353633 1 c sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1135352267 32852
+1135362635 0 c 386/bin/ip/ping - 775 sys sys 1135360964 76456
+1135362635 1 c 386/bin/upas/marshal - 775 sys sys 1135360965 133019
+1135371643 0 c sys/src/libmemdraw/alloc.c - 664 sys sys 1135370394 3324
+1135395044 0 c sys/src/libmemdraw/alloc.c - 664 sys sys 1135394719 3332

+ 2 - 3
sys/src/cmd/ip/ping.c

@@ -144,8 +144,7 @@ sender(int fd, int msglen, int interval, int n)
 		}
 		r = malloc(sizeof *r);
 		if(r != nil){
-			ip->seq[0] = seq;
-			ip->seq[1] = seq>>8;
+			hnputs(ip->seq, seq);
 			r->seq = seq;
 			r->next = nil;
 			lock(&listlock);
@@ -200,7 +199,7 @@ fprint(2, "clean\n");
 				munged++;
 		if(munged)
 			print("currupted reply\n");
-		x = (ip->seq[1]<<8)|ip->seq[0];
+		x = nhgets(ip->seq);
 		if(ip->type != EchoReply || ip->code != 0) {
 			print("bad sequence/code/type %d/%d/%d\n",
 				ip->type, ip->code, x);

+ 4 - 1
sys/src/cmd/upas/marshal/marshal.c

@@ -1125,6 +1125,7 @@ pgpfilter(int *pid, int fd, int pgpflag)
 	v = av = emalloc(sizeof(char*)*8);
 	ac = 0;
 	v[ac++] = "pgp";
+	v[ac++] = "-fat";		/* operate as a filter, generate text */
 	if(pgpflag & PGPsign)
 		v[ac++] = "-s";
 	if(pgpflag & PGPencrypt)
@@ -1144,7 +1145,9 @@ pgpfilter(int *pid, int fd, int pgpflag)
 		dup(fd, 1);
 		close(fd);
 
-		exec("/bin/upas/pgp", av);
+		/* add newline to avoid confusing pgp output with 822 headers */
+		write(1, "\n", 1);
+		exec("/bin/pgp", av);
 		fatal("execing: %r");
 		break;
 	default:

+ 10 - 6
sys/src/libmemdraw/alloc.c

@@ -17,7 +17,7 @@ memimagemove(void *from, void *to)
 	md->base = to;
 
 	/* if allocmemimage changes this must change too */
-	md->bdata = (uchar*)&md->base[2];
+	md->bdata = (uchar*)md->base+sizeof(Memdata*)+sizeof(ulong);
 }
 
 Memimage*
@@ -67,6 +67,7 @@ Memimage*
 allocmemimage(Rectangle r, ulong chan)
 {
 	int d;
+	uchar *p;
 	ulong l, nw;
 	Memdata *md;
 	Memimage *i;
@@ -83,18 +84,21 @@ allocmemimage(Rectangle r, ulong chan)
 		return nil;
 
 	md->ref = 1;
-	md->base = poolalloc(imagmem, (2+nw)*sizeof(ulong));
+	md->base = poolalloc(imagmem, sizeof(Memdata*)+(1+nw)*sizeof(ulong));
 	if(md->base == nil){
 		free(md);
 		return nil;
 	}
 
-	md->base[0] = (ulong)md;
-	md->base[1] = getcallerpc(&r);
+	p = (uchar*)md->base;
+	*(Memdata**)p = md;
+	p += sizeof(Memdata*);
 
-	/* if this changes, memimagemove must change too */
-	md->bdata = (uchar*)&md->base[2];
+	*(ulong*)p = getcallerpc(&r);
+	p += sizeof(ulong);
 
+	/* if this changes, memimagemove must change too */
+	md->bdata = p;
 	md->allocd = 1;
 
 	i = allocmemimaged(r, chan, md);