Plan 9 from Bell Labs’s /usr/web/sources/extra/changes/2005/1223

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Use the same byte order everyone else does.
 [rsc] --rw-rw-r-- M 777458 glenda sys 5611 Dec 23 10:37 sys/src/cmd/ip/ping.c
	/n/sourcesdump/2005/1223/plan9/sys/src/cmd/ip/ping.c:144,151 - 
	/n/sourcesdump/2005/1224/plan9/sys/src/cmd/ip/ping.c:144,150
	  		}
	  		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);
	/n/sourcesdump/2005/1223/plan9/sys/src/cmd/ip/ping.c:200,206 - 
	/n/sourcesdump/2005/1224/plan9/sys/src/cmd/ip/ping.c:199,205
	  				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);

Invoke pgp correctly.
 [rsc] --rw-rw-r-- M 777458 glenda sys 32852 Dec 23 10:37 sys/src/cmd/upas/marshal/marshal.c
	/n/sourcesdump/2005/1223/plan9/sys/src/cmd/upas/marshal/marshal.c:1125,1130 - 
	/n/sourcesdump/2005/1224/plan9/sys/src/cmd/upas/marshal/marshal.c:1125,1131
	  	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)
	/n/sourcesdump/2005/1223/plan9/sys/src/cmd/upas/marshal/marshal.c:1144,1150 - 
	/n/sourcesdump/2005/1224/plan9/sys/src/cmd/upas/marshal/marshal.c:1145,1153
	  		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:

64-bit safe.
 [rsc] --rw-rw-r-- M 777458 glenda sys 3332 Dec 23 22:25 sys/src/libmemdraw/alloc.c
	/n/sourcesdump/2005/1223/plan9/sys/src/libmemdraw/alloc.c:17,23 - 
	/n/sourcesdump/2005/1224/plan9/sys/src/libmemdraw/alloc.c:17,23
	  	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*
	/n/sourcesdump/2005/1223/plan9/sys/src/libmemdraw/alloc.c:67,72 - 
	/n/sourcesdump/2005/1224/plan9/sys/src/libmemdraw/alloc.c:67,73
	  allocmemimage(Rectangle r, ulong chan)
	  {
	  	int d;
	+ 	uchar *p;
	  	ulong l, nw;
	  	Memdata *md;
	  	Memimage *i;
	/n/sourcesdump/2005/1223/plan9/sys/src/libmemdraw/alloc.c:83,100 - 
	/n/sourcesdump/2005/1224/plan9/sys/src/libmemdraw/alloc.c:84,104
	  		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);
 [rsc] --rw-rw-r-- M 777458 glenda sys 3332 Dec 23 22:25 sys/src/libmemdraw/alloc.c


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].