Browse Source

Plan 9 from Bell Labs 2005-01-29

David du Colombier 16 years ago
parent
commit
5402420064

+ 9 - 6
dist/replica/_plan9.db

@@ -3903,7 +3903,7 @@ sys/lib/httpd.rewrite - 664 sys sys 954262980 825
 sys/lib/kbmap - 20000000775 sys sys 1079535430 0
 sys/lib/kbmap/ascii - 664 sys sys 1082221421 6248
 sys/lib/kbmap/azerty - 644 sys sys 1079473812 735
-sys/lib/kbmap/bgmap - 664 sys sys 1079475826 561
+sys/lib/kbmap/bg - 664 sys sys 1106924292 561
 sys/lib/kbmap/de - 664 sys sys 1100894012 6265
 sys/lib/kbmap/ee - 644 sys sys 1080222237 429
 sys/lib/kbmap/es - 664 sys sys 1079535430 1360
@@ -4687,7 +4687,7 @@ sys/man/1/db - 664 sys sys 1015024738 17862
 sys/man/1/dc - 664 sys sys 944959674 4834
 sys/man/1/dd - 664 sys sys 1055693436 3346
 sys/man/1/deroff - 664 sys sys 1017423524 1826
-sys/man/1/diff - 664 sys sys 1106723601 2907
+sys/man/1/diff - 664 sys sys 1106938097 2960
 sys/man/1/doc2txt - 664 sys sys 1105020018 2077
 sys/man/1/doctype - 664 sys sys 944959673 849
 sys/man/1/du - 664 sys sys 1017166323 1410
@@ -7364,9 +7364,9 @@ sys/src/cmd/dict/world.c - 664 sys sys 944960882 4264
 sys/src/cmd/diff - 20000000775 sys sys 944960882 0
 sys/src/cmd/diff/diff.h - 664 sys sys 1106723609 794
 sys/src/cmd/diff/diffdir.c - 664 sys sys 1014925333 1791
-sys/src/cmd/diff/diffio.c - 664 sys sys 1106723609 6378
+sys/src/cmd/diff/diffio.c - 664 sys sys 1106938096 6599
 sys/src/cmd/diff/diffreg.c - 664 sys sys 1106723609 8842
-sys/src/cmd/diff/main.c - 664 sys sys 1106151067 4325
+sys/src/cmd/diff/main.c - 664 sys sys 1106938096 4338
 sys/src/cmd/diff/mkfile - 664 sys sys 944960882 141
 sys/src/cmd/disk - 20000000775 sys sys 1018468546 0
 sys/src/cmd/disk/9660 - 20000000775 sys sys 1017681443 0
@@ -7411,7 +7411,7 @@ sys/src/cmd/disk/kfs/errno.h - 664 sys sys 1015009189 1317
 sys/src/cmd/disk/kfs/fns.h - 664 sys sys 1019058719 1010
 sys/src/cmd/disk/kfs/ialloc.c - 664 sys sys 944960883 103
 sys/src/cmd/disk/kfs/iobuf.c - 664 sys sys 1015009189 3769
-sys/src/cmd/disk/kfs/main.c - 664 sys sys 1022112155 9420
+sys/src/cmd/disk/kfs/main.c - 664 sys sys 1106924274 9515
 sys/src/cmd/disk/kfs/misc.c - 664 sys sys 1015009189 1182
 sys/src/cmd/disk/kfs/mkfile - 664 sys sys 1065916865 717
 sys/src/cmd/disk/kfs/ofcallfmt.c - 664 sys sys 1015009189 4674
@@ -9547,7 +9547,7 @@ sys/src/cmd/ip/snoopy/udp.c - 664 sys sys 1089299190 1990
 sys/src/cmd/ip/telnet.c - 664 sys sys 1080058033 8535
 sys/src/cmd/ip/telnet.h - 664 sys sys 1015090250 5902
 sys/src/cmd/ip/telnetd.c - 664 sys sys 1032060109 11731
-sys/src/cmd/ip/tftpd.c - 664 sys sys 1106624712 7642
+sys/src/cmd/ip/tftpd.c - 664 sys sys 1106943821 7646
 sys/src/cmd/ip/traceroute.c - 664 sys sys 1032060124 9370
 sys/src/cmd/ip/udpecho.c - 664 sys sys 1050714674 855
 sys/src/cmd/join.c - 664 sys sys 944961364 7488
@@ -12456,3 +12456,6 @@ 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/diff - 775 sys sys 1106971478 85101
+386/bin/disk/kfs - 775 sys sys 1106971479 248849
+386/bin/ip/tftpd - 775 sys sys 1106971479 129489

+ 9 - 9
dist/replica/plan9.db

@@ -195,13 +195,13 @@
 386/bin/dial/expect - 775 sys sys 1104122000 60081
 386/bin/dial/pass - 775 sys sys 1104122001 38814
 386/bin/dict - 775 sys sys 1104122001 187459
-386/bin/diff - 775 sys sys 1106799173 84923
+386/bin/diff - 775 sys sys 1106971478 85101
 386/bin/disk - 20000000775 sys sys 984788664 0
 386/bin/disk/dump9660 - 775 sys sys 1104122002 152246
 386/bin/disk/exsort - 775 sys sys 1104122002 60210
 386/bin/disk/fdisk - 775 sys sys 1104122003 103794
 386/bin/disk/format - 775 sys sys 1104122003 89534
-386/bin/disk/kfs - 775 sys sys 1106107677 248770
+386/bin/disk/kfs - 775 sys sys 1106971479 248849
 386/bin/disk/kfscmd - 775 sys sys 1104122004 38222
 386/bin/disk/ksync - 775 sys sys 1020319074 302
 386/bin/disk/mbr - 775 sys sys 1104122004 73689
@@ -297,7 +297,7 @@
 386/bin/ip/rip - 775 sys sys 1104122029 91232
 386/bin/ip/rlogind - 775 sys sys 1104122029 67402
 386/bin/ip/telnetd - 775 sys sys 1104122030 121992
-386/bin/ip/tftpd - 775 sys sys 1106799176 129444
+386/bin/ip/tftpd - 775 sys sys 1106971479 129489
 386/bin/ip/traceroute - 775 sys sys 1104122030 73497
 386/bin/ip/udpecho - 775 sys sys 1104122030 43159
 386/bin/join - 775 sys sys 1104122031 116241
@@ -3903,7 +3903,7 @@ sys/lib/httpd.rewrite - 664 sys sys 954262980 825
 sys/lib/kbmap - 20000000775 sys sys 1079535430 0
 sys/lib/kbmap/ascii - 664 sys sys 1082221421 6248
 sys/lib/kbmap/azerty - 644 sys sys 1079473812 735
-sys/lib/kbmap/bgmap - 664 sys sys 1079475826 561
+sys/lib/kbmap/bg - 664 sys sys 1106924292 561
 sys/lib/kbmap/de - 664 sys sys 1100894012 6265
 sys/lib/kbmap/ee - 644 sys sys 1080222237 429
 sys/lib/kbmap/es - 664 sys sys 1079535430 1360
@@ -4687,7 +4687,7 @@ sys/man/1/db - 664 sys sys 1015024738 17862
 sys/man/1/dc - 664 sys sys 944959674 4834
 sys/man/1/dd - 664 sys sys 1055693436 3346
 sys/man/1/deroff - 664 sys sys 1017423524 1826
-sys/man/1/diff - 664 sys sys 1106723601 2907
+sys/man/1/diff - 664 sys sys 1106938097 2960
 sys/man/1/doc2txt - 664 sys sys 1105020018 2077
 sys/man/1/doctype - 664 sys sys 944959673 849
 sys/man/1/du - 664 sys sys 1017166323 1410
@@ -7364,9 +7364,9 @@ sys/src/cmd/dict/world.c - 664 sys sys 944960882 4264
 sys/src/cmd/diff - 20000000775 sys sys 944960882 0
 sys/src/cmd/diff/diff.h - 664 sys sys 1106723609 794
 sys/src/cmd/diff/diffdir.c - 664 sys sys 1014925333 1791
-sys/src/cmd/diff/diffio.c - 664 sys sys 1106723609 6378
+sys/src/cmd/diff/diffio.c - 664 sys sys 1106938096 6599
 sys/src/cmd/diff/diffreg.c - 664 sys sys 1106723609 8842
-sys/src/cmd/diff/main.c - 664 sys sys 1106151067 4325
+sys/src/cmd/diff/main.c - 664 sys sys 1106938096 4338
 sys/src/cmd/diff/mkfile - 664 sys sys 944960882 141
 sys/src/cmd/disk - 20000000775 sys sys 1018468546 0
 sys/src/cmd/disk/9660 - 20000000775 sys sys 1017681443 0
@@ -7411,7 +7411,7 @@ sys/src/cmd/disk/kfs/errno.h - 664 sys sys 1015009189 1317
 sys/src/cmd/disk/kfs/fns.h - 664 sys sys 1019058719 1010
 sys/src/cmd/disk/kfs/ialloc.c - 664 sys sys 944960883 103
 sys/src/cmd/disk/kfs/iobuf.c - 664 sys sys 1015009189 3769
-sys/src/cmd/disk/kfs/main.c - 664 sys sys 1022112155 9420
+sys/src/cmd/disk/kfs/main.c - 664 sys sys 1106924274 9515
 sys/src/cmd/disk/kfs/misc.c - 664 sys sys 1015009189 1182
 sys/src/cmd/disk/kfs/mkfile - 664 sys sys 1065916865 717
 sys/src/cmd/disk/kfs/ofcallfmt.c - 664 sys sys 1015009189 4674
@@ -9547,7 +9547,7 @@ sys/src/cmd/ip/snoopy/udp.c - 664 sys sys 1089299190 1990
 sys/src/cmd/ip/telnet.c - 664 sys sys 1080058033 8535
 sys/src/cmd/ip/telnet.h - 664 sys sys 1015090250 5902
 sys/src/cmd/ip/telnetd.c - 664 sys sys 1032060109 11731
-sys/src/cmd/ip/tftpd.c - 664 sys sys 1106624712 7642
+sys/src/cmd/ip/tftpd.c - 664 sys sys 1106943821 7646
 sys/src/cmd/ip/traceroute.c - 664 sys sys 1032060124 9370
 sys/src/cmd/ip/udpecho.c - 664 sys sys 1050714674 855
 sys/src/cmd/join.c - 664 sys sys 944961364 7488

+ 10 - 0
dist/replica/plan9.log

@@ -13334,3 +13334,13 @@
 1106800218 26 c 386/bin/vt - 775 sys sys 1106799182 172859
 1106800218 27 c 386/lib/ape/libdraw.a - 664 sys sys 1106799183 573884
 1106800218 28 c 386/lib/libdraw.a - 664 sys sys 1106799185 373548
+1106924442 0 a sys/lib/kbmap/bg - 664 sys sys 1106924292 561
+1106924442 1 c sys/src/cmd/disk/kfs/main.c - 664 sys sys 1106924274 9515
+1106924442 2 d sys/lib/kbmap/bgmap - 664 sys sys 1079475826 0
+1106938845 0 c sys/man/1/diff - 664 sys sys 1106938097 2960
+1106938845 1 c sys/src/cmd/diff/diffio.c - 664 sys sys 1106938096 6599
+1106938845 2 c sys/src/cmd/diff/main.c - 664 sys sys 1106938096 4338
+1106944246 0 c sys/src/cmd/ip/tftpd.c - 664 sys sys 1106943821 7646
+1106973052 0 c 386/bin/diff - 775 sys sys 1106971478 85101
+1106973052 1 c 386/bin/disk/kfs - 775 sys sys 1106971479 248849
+1106973052 2 c 386/bin/ip/tftpd - 775 sys sys 1106971479 129489

+ 0 - 0
sys/lib/kbmap/bgmap → sys/lib/kbmap/bg


+ 4 - 1
sys/man/1/diff

@@ -4,7 +4,7 @@ diff \- differential file comparator
 .SH SYNOPSIS
 .B diff
 [
-.B -cefmnbwr
+.B -acefmnbwr
 ] file1 ... file2
 .SH DESCRIPTION
 .I Diff
@@ -127,6 +127,9 @@ The
 .B -c
 option includes three lines of context around each
 change, merging changes whose contexts overlap.
+The
+.B -a
+flag displays the entire file as context.
 .PP
 Except in rare circumstances,
 .I diff

+ 22 - 6
sys/src/cmd/diff/diffio.c

@@ -302,6 +302,7 @@ change(int a, int b, int c, int d)
 		range(a, b, " ");
 		break;
 	case 'c':
+	case 'a':
 		if(nchanges%1024 == 0)
 			changes = erealloc(changes, (nchanges+1024)*sizeof(changes[0]));
 		ch = &changes[nchanges++];
@@ -348,24 +349,39 @@ flushchanges(void)
 	
 	for(i=0; i<nchanges; ){
 		j = changeset(i);
-		a = changes[i].a;
-		b = changes[j-1].b;
-		c = changes[i].c;
-		d = changes[j-1].d;
+		a = changes[i].a-Lines;
+		b = changes[j-1].b+Lines;
+		c = changes[i].c-Lines;
+		d = changes[j-1].d+Lines;
+		if(a < 1)
+			a = 1;
+		if(c < 1)
+			c = 1;
+		if(b > len[0])
+			b = len[0];
+		if(d > len[1])
+			d = len[1];
+		if(mode == 'a'){
+			a = 1;
+			b = len[0];
+			c = 1;
+			d = len[1];
+			j = nchanges;
+		}
 		Bprint(&stdout, "%s:", file1);
 		range(a, b, ",");
 		Bprint(&stdout, " - ");
 		Bprint(&stdout, "%s:", file2);
 		range(c, d, ",");
 		Bputc(&stdout, '\n');
-		at = a-Lines;
+		at = a;
 		for(; i<j; i++){
 			fetch(ixold, at, changes[i].a-1, input[0], "  ");
 			fetch(ixold, changes[i].a, changes[i].b, input[0], "< ");
 			fetch(ixnew, changes[i].c, changes[i].d, input[1], "> ");
 			at = changes[i].b+1;
 		}
-		fetch(ixold, at, b+Lines, input[0], "  ");
+		fetch(ixold, at, b, input[0], "  ");
 	}
 	nchanges = 0;
 }

+ 1 - 0
sys/src/cmd/diff/main.c

@@ -191,6 +191,7 @@ main(int argc, char *argv[])
 			case 'f':
 			case 'n':
 			case 'c':
+			case 'a':
 				mode = *p;
 				break;
 

+ 3 - 0
sys/src/cmd/disk/kfs/main.c

@@ -97,6 +97,9 @@ main(int argc, char *argv[])
 
 	cmdfd = 2;
 
+	if (access(wrenfile, AREAD|AWRITE) == -1)
+		sysfatal("%s cannot access device\n", wrenfile);
+
 	formatinit();
 	sublockinit();
 

+ 4 - 4
sys/src/cmd/ip/tftpd.c

@@ -107,7 +107,7 @@ main(int argc, char **argv)
 	if (cfd < 0)
 		sysfatal("announcing on %s: %r", buf);
 	syslog(dbg, flog, "tftpd started on %s dir %s", buf, adir);
-//	setuser();	Moved to doserve [sape]
+	setuser();
 	for(;;) {
 		lcfd = listen(adir, ldir);
 		if(lcfd < 0)
@@ -140,7 +140,6 @@ doserve(int fd)
 	char *mode, *p;
 	short op;
 
-	setuser();
 	dlen = read(fd, bigbuf, sizeof(bigbuf));
 	if(dlen < 0)
 		sysfatal("listen read: %r");
@@ -411,11 +410,12 @@ sunkernel(char *name)
 	uchar v6[IPaddrlen];
 	char buf[256];
 	char ipbuf[128];
+	char *suffix;
 
-	if(strlen(name) != 14 || strncmp(name + 8, ".SUN", 4) != 0)
+	addr = strtoul(name, &suffix, 16);
+	if(suffix-name != 8 || (strcmp(suffix, "") != 0 && strcmp(suffix, ".SUN") != 0))
 		return name;
 
-	addr = strtoul(name, 0, 16);
 	v4[0] = addr>>24;
 	v4[1] = addr>>16;
 	v4[2] = addr>>8;