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

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


Use MS-DOS style numbering for COMx.
 [rsc] --rw-rw-r-- M 28433 jmk sys 1777 Sep 19 06:48 sys/src/9/pc/uartisa.c
	/n/sourcesdump/2005/0919/plan9/sys/src/9/pc/uartisa.c:34,40 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/9/pc/uartisa.c:34,40
	  	}
	  
	  	uart->regs = ctlr;
	- 	snprint(buf, sizeof(buf), "COM%d", ctlrno);
	+ 	snprint(buf, sizeof(buf), "COM%d", ctlrno+1);
	  	kstrdup(&uart->name, buf);
	  	uart->freq = isa->freq;
	  	uart->phys = &i8250physuart;

Move atexit into its own file.
 [rsc] --rw-rw-r-- M 28433 rsc sys 220 Sep 19 06:47 sys/src/ape/lib/ap/stdio/atexit.c
 [rsc] --rw-rw-r-- M 28433 glenda sys 321 Sep 19 06:47 sys/src/ape/lib/ap/stdio/exit.c
	/n/sourcesdump/2005/0919/plan9/sys/src/ape/lib/ap/stdio/exit.c:15,27 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/ape/lib/ap/stdio/exit.c:15,17
	  	_doatexits();
	  	_exit(status);
	  }
	- atexit(int (*f)(void))
	- {
	- 	int i;
	- 	for(i=0; i<NONEXIT; i++)
	- 		if(!_atexitfns[i]){
	- 			_atexitfns[i] = f;
	- 			return(0);
	- 		}
	- 	return(1);
	- }
 [rsc] --rw-rw-r-- M 28433 glenda sys 841 Sep 19 06:47 sys/src/ape/lib/ap/stdio/mkfile
	/n/sourcesdump/2005/0919/plan9/sys/src/ape/lib/ap/stdio/mkfile:7,12 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/ape/lib/ap/stdio/mkfile:7,13
	  	_dtoa.$O\
	  	_fconv.$O\
	  	clearerr.$O\
	+ 	atexit.$O\
	  	exit.$O\
	  	fclose.$O\
	  	fdopen.$O\

Add (undocumented) sysr1 builtin, useful during kernel debugging.
 [rsc] --rw-rw-r-- M 28433 glenda sys 20156 Sep 19 06:49 sys/src/cmd/acid/builtin.c
	/n/sourcesdump/2005/0919/plan9/sys/src/cmd/acid/builtin.c:39,44 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/cmd/acid/builtin.c:39,45
	  void	interpret(Node*, Node*);
	  void	include(Node*, Node*);
	  void	regexp(Node*, Node*);
	+ void dosysr1(Node*, Node*);
	  
	  typedef struct Btab Btab;
	  struct Btab
	/n/sourcesdump/2005/0919/plan9/sys/src/cmd/acid/builtin.c:73,78 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/cmd/acid/builtin.c:74,80
	  	"status",	status,
	  	"stop",		stop,
	  	"strace",	strace,
	+ 	"sysr1",	dosysr1,
	  	"waitstop",	waitstop,
	  	"map",		map,
	  	"interpret",	interpret,
	/n/sourcesdump/2005/0919/plan9/sys/src/cmd/acid/builtin.c:109,114 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/cmd/acid/builtin.c:111,127
	  			mkprint(s);
	  		b++;
	  	}
	+ }
	+ 
	+ void
	+ dosysr1(Node *r, Node*)
	+ {
	+ 	extern int sysr1(void);
	+ 	
	+ 	r->op = OCONST;
	+ 	r->type = TINT;
	+ 	r->fmt = 'D';
	+ 	r->ival = sysr1();
	  }
	  
	  void

Add setmalloctag calls to help find memory leaks.
 [rsc] --rw-rw-r-- M 28433 glenda sys 617 Sep 19 07:19 sys/src/libmp/port/betomp.c
	/n/sourcesdump/2005/0919/plan9/sys/src/libmp/port/betomp.c:9,16 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libmp/port/betomp.c:9,18
	  	int m, s;
	  	mpdigit x;
	  
	- 	if(b == nil)
	+ 	if(b == nil){
	  		b = mpnew(0);
	+ 		setmalloctag(b, getcallerpc(&p));
	+ 	}
	  
	  	// dump leading zeros
	  	while(*p == 0 && n > 1){
 [rsc] --rw-rw-r-- M 28433 glenda sys 2685 Sep 19 07:19 sys/src/libmp/port/mpaux.c
	/n/sourcesdump/2005/0919/plan9/sys/src/libmp/port/mpaux.c:58,63 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libmp/port/mpaux.c:58,64
	  		sysfatal("mpsetminbits: n < 0");
	  
	  	b = mallocz(sizeof(mpint), 1);
	+ 	setmalloctag(b, getcallerpc(&n));
	  	if(b == nil)
	  		sysfatal("mpnew: %r");
	  	n = DIGITS(n);
 [rsc] --rw-rw-r-- M 28433 glenda sys 915 Sep 19 07:19 sys/src/libmp/port/mptobe.c
	/n/sourcesdump/2005/0919/plan9/sys/src/libmp/port/mptobe.c:15,20 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libmp/port/mptobe.c:15,21
	  	if(p == nil){
	  		n = (b->top+1)*Dbytes;
	  		p = malloc(n);
	+ 		setmalloctag(p, getcallerpc(&b));
	  	}
	  	if(p == nil)
	  		return -1;

Your text here.
 [rsc] --rw-rw-r-- M 28433 glenda sys 50918 Sep 19 07:19 sys/src/libsec/port/x509.c
	/n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:172,177 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:172,178
	  		exits("out of memory");
	  	}
	  	memset(p, 0, n);
	+ 	setmalloctag(p, getcallerpc(&n));
	  	return p;
	  }
	  
	/n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:259,267 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:260,270
	  	if(err == ASN_OK) {
	  		err = length_decode(pp, pend, &length);
	  		if(err == ASN_OK) {
	- 			if(tag.class == Universal)
	+ 			if(tag.class == Universal) {
	  				err = value_decode(pp, pend, length, tag.num, isconstr, &val);
	- 			else
	+ 				if(val.tag == VSeq || val.tag == VSet)
	+ 					setmalloctag(val.u.seqval, getcallerpc(&pp));
	+ 			}else
	  				err = value_decode(pp, pend, length, OCTET_STRING, 0, &val);
	  			if(err == ASN_OK) {
	  				pelem->tag = tag;
	/n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:498,503 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:501,507
	  
	  	case SEQUENCE:
	  		err = seq_decode(&p, pend, length, isconstr, &vl);
	+ 		setmalloctag(vl, getcallerpc(&pp));
	  		if(err == ASN_OK) {
	  			pval->tag = VSeq ;
	  			pval->u.seqval = vl;
	/n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:506,511 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:510,516
	  
	  	case SETOF:
	  		err = seq_decode(&p, pend, length, isconstr, &vl);
	+ 		setmalloctag(vl, getcallerpc(&pp));
	  		if(err == ASN_OK) {
	  			pval->tag = VSet;
	  			pval->u.setval = vl;
	/n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:742,747 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:747,753
	  	}
	  	*pp = p;
	  	*pelist = ans;
	+ 	setmalloctag(ans, getcallerpc(&pp));
	  	return err;
	  }
	  
	/n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:1402,1407 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:1408,1414
	  	Elist* el;
	  
	  	el = (Elist*)emalloc(sizeof(Elist));
	+ 	setmalloctag(el, getcallerpc(&e));
	  	el->hd = e;
	  	el->tl = tail;
	  	return el;
	/n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:2042,2048 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:2049,2054
	  	/* see 9.2.1 of rfc2437 */
	  	pkcs1 = betomp(signature->data, signature->len, nil);
	  	mpexp(pkcs1, pk->ek, pk->n, pkcs1);
	- 	pkcs1buf = nil;
	  	buflen = mptobe(pkcs1, nil, 0, &pkcs1buf);
	  	buf = pkcs1buf;
	  	if(buflen != nlen || buf[0] != 1) {

Add &mdash; and &ndash;
 [rsc] --rw-rw-r-- M 28433 glenda sys 25915 Sep 19 22:28 sys/src/libhtml/lex.c
	/n/sourcesdump/2005/0919/plan9/sys/src/libhtml/lex.c:250,256 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libhtml/lex.c:250,256
	  
	  // Character entity to unicode character number map.
	  // Keep sorted by name.
	- StringInt	chartab[142]= {
	+ StringInt	chartab[]= {
	  	{L"AElig", 198},
	  	{L"Aacute", 193},
	  	{L"Acirc", 194},
	/n/sourcesdump/2005/0919/plan9/sys/src/libhtml/lex.c:307,315 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libhtml/lex.c:307,315
	  	{L"eacute", 233},
	  	{L"ecirc", 234},
	  	{L"egrave", 232},
	- 	{L"emdash", 8212},
	+ 	{L"emdash", 8212},	/* non-standard but commonly used */
	  	{L"emsp", 8195},
	- 	{L"endash", 8211},
	+ 	{L"endash", 8211},	/* non-standard but commonly used */
	  	{L"ensp", 8194},
	  	{L"epsilon", 949},
	  	{L"eta", 951},
	/n/sourcesdump/2005/0919/plan9/sys/src/libhtml/lex.c:333,342 - 
	/n/sourcesdump/2005/0920/plan9/sys/src/libhtml/lex.c:333,344
	  	{L"ldots", 8230},
	  	{L"lt", 60},
	  	{L"macr", 175},
	+ 	{L"mdash", 8212},
	  	{L"micro", 181},
	  	{L"middot", 183},
	  	{L"mu", 956},
	  	{L"nbsp", 160},
	+ 	{L"ndash", 8211},
	  	{L"not", 172},
	  	{L"ntilde", 241},
	  	{L"nu", 957},
 [rsc] --rw-rw-r-- M 28433 glenda sys 25915 Sep 19 22:28 sys/src/libhtml/lex.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].