Plan 9 from Bell Labs’s /usr/web/sources/extra/changes/2006/0123

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


Clean up killbig.
 [rsc] --rw-rw-r-- M 1118886 glenda sys 27967 Jan 23 09:58 sys/src/9/port/proc.c
	[diffs elided]
 [rsc] --rw-rw-r-- M 1118886 glenda sys 7019 Jan 23 09:58 sys/src/9/port/swap.c
	/n/sourcesdump/2006/0123/plan9/sys/src/9/port/swap.c:160,172 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/9/port/swap.c:160,172
	  			qunlock(&p->seglock);
	  		}
	  		else {
	+ 			print("out of physical memory; no swap configured\n");
	  			if(!cpuserver)
	  				freebroken();	/* can use the memory */
	  			else
	- 				killbig();
	+ 				killbig("out of memory");
	  
	  			/* Emulate the old system if no swap channel */
	- 			print("no physical memory\n");
	  			tsleep(&up->sleep, return0, 0, 5000);
	  			wakeup(&palloc.r);
	  		}
 [rsc] --rw-rw-r-- M 1118886 glenda sys 23013 Jan 23 15:22 sys/src/9/port/devcons.c
	/n/sourcesdump/2006/0123/plan9/sys/src/9/port/devcons.c:460,466 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/9/port/devcons.c:460,466
	  			scheddump();
	  			return;
	  		case 'k':
	- 			killbig();
	+ 			killbig("^t ^t k");
	  			return;
	  		case 'r':
	  			exit(0);
 [rsc] --rw-rw-r-- M 1118886 glenda sys 11023 Jan 23 15:23 sys/src/9/port/portfns.h
	/n/sourcesdump/2006/0123/plan9/sys/src/9/port/portfns.h:144,150 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/9/port/portfns.h:144,150
	  int		kbdputc(Queue*, int);
	  void		kbdputmap(ushort, ushort, Rune);
	  void		kickpager(void);
	- void		killbig(void);
	+ void		killbig(char*);
	  void		kproc(char*, void(*)(void*), void*);
	  void		kprocchild(Proc*, void (*)(void*), void*);
	  void		(*kproftimer)(ulong);

Clean up usbaudio, usbmouse.
 [rsc] --rw-rw-r-- M 1118886 sape sys 9843 Jan 23 09:37 sys/src/cmd/usb/audio/usbaudio.c
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/usb/audio/usbaudio.c:16,22 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/usb/audio/usbaudio.c:16,22
	  
	  Channel *controlchan;
	  
	- char audstr[]		= "Enabled 0x000101\n";	/* audio.control.0 */
	+ char audstr[]		= "Enabled 0x000101";	/* audio.control.0 */
	  
	  int defaultspeed[2] = {44100, 44100};
	  
 [rsc] --rw-rw-r-- M 1118886 sape sys 3475 Jan 23 09:37 sys/src/cmd/usb/misc/usbmouse.c
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/usb/misc/usbmouse.c:1,11 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/usb/misc/usbmouse.c:1,10
	  #include <u.h>
	  #include <libc.h>
	  #include <thread.h>
	- #include <stdio.h>
	  
	  int mousefd, ctlfd, mousein;
	  
	- char hbm[]		= "Enabled 0x020103\n";
	+ char hbm[]		= "Enabled 0x020103";
	  char *mouseinfile	= "/dev/mousein";
	  char *statfmt		= "/dev/usb%d/%d/status";
	  char *ctlfmt		= "/dev/usb%d/%d/ctl";
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/usb/misc/usbmouse.c:87,94 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/usb/misc/usbmouse.c:86,92
	  void
	  threadmain(int argc, char *argv[])
	  {
	- 	FILE *f;
	- 	int ctlrno, i;
	+ 	int ctlrno, i, sfd;
	  	char line[256];
	  
	  	ARGBEGIN{
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/usb/misc/usbmouse.c:112,128 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/usb/misc/usbmouse.c:110,126
	  	case 0:
	  		for (ctlrno = 0; ctlrno < 16; ctlrno++) {
	  			for (i = 0; i < 128; i++) {
	- 				sprint(line, statfmt, ctlrno, i);
	- 				f = fopen(line, "r");
	- 				if (f == nil)
	+ 				snprint(line, sizeof line, statfmt, ctlrno, i);
	+ 				sfd = open(line, OREAD);
	+ 				if (sfd < 0)
	  					break;
	- 				if (fgets(line, sizeof line, f) && strcmp(hbm, line) == 0) {
	+ 				if (read(sfd, line, strlen(hbm)) && strncmp(hbm, line, strlen(hbm)) == 0) {
	  					snprint(ctlfile, sizeof ctlfile, ctlfmt, ctlrno, i);
	  					snprint(msefile, sizeof msefile, msefmt, ctlrno, i);
	- 					fclose(f);
	+ 					close(sfd);
	  					goto found;
	  				}
	- 				fclose(f);
	+ 				close(sfd);
	  			}
	  		}
	  		threadexitsall("no mouse");

Fix handling of Location: with no server.
 [rsc] --rw-rw-r-- M 1118886 glenda sys 25946 Jan 23 15:33 sys/src/cmd/hget.c
	[diffs elided]

Add back -n flag to mount.
 [rsc] --rw-rw-r-- M 1118886 glenda sys 4009 Jan 23 19:19 sys/man/1/bind
	/n/sourcesdump/2006/0123/plan9/sys/man/1/bind:144,155 - 
	/n/sourcesdump/2006/0124/plan9/sys/man/1/bind:144,161
	  .PD
	  .PP
	  .I Mount
	- takes an additional option,
	+ takes two additional options.
	+ The first,
	  .B -k
	  .IR keypattern ,
	- to constrain the set of 
	+ constrains the set of 
	  .IR factotum (4)
	  keys used for an authenticated mount.
	+ The second,
	+ .BR -n ,
	+ causes
	+ .I mount
	+ to skip authentication entirely.
	  .PP
	  The
	  .I spec
 [rsc] --rw-rw-r-- M 1118886 glenda sys 1633 Jan 23 19:17 sys/src/cmd/mount.c
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/mount.c:30,36 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/mount.c:30,37
	  	char *spec;
	  	ulong flag = 0;
	  	int qflag = 0;
	- 	int fd;
	+ 	int noauth = 0;
	+ 	int fd, rv;
	  
	  	ARGBEGIN{
	  	case 'a':
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/mount.c:48,53 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/mount.c:49,57
	  	case 'k':
	  		keyspec = EARGF(usage());
	  		break;
	+ 	case 'n':
	+ 		noauth = 1;
	+ 		break;
	  	case 'q':
	  		qflag = 1;
	  		break;
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/mount.c:75,81 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/mount.c:79,89
	  	}
	  
	  	notify(catch);
	- 	if(amount0(fd, argv[1], flag, spec, keyspec) < 0){
	+ 	if(noauth)
	+ 		rv = mount(fd, -1, argv[1], flag, spec);
	+ 	else
	+ 		rv = amount0(fd, argv[1], flag, spec, keyspec);
	+ 	if(rv < 0){
	  		if(qflag)
	  			exits(0);
	  		fprint(2, "%s: mount %s: %r\n", argv0, argv[1]);
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/mount.c:95,100 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/mount.c:103,108
	  void
	  usage(void)
	  {
	- 	fprint(2, "usage: mount [-a|-b] [-c] [-k keypattern] [-r] /srv/service dir [spec]\n");
	+ 	fprint(2, "usage: mount [-a|-b] [-cnrq] [-k keypattern] /srv/service dir [spec]\n");
	  	exits("usage");
	  }

Fixes from Steve Simon.
 [rsc] --rw-rw-r-- M 1118886 jmk sys 14094 Jan 23 20:15 sys/src/cmd/aux/msexceltables.c
	[diffs elided]

Send up-events for scroll wheel.
 [rsc] --rw-rw-r-- M 1118886 rsc sys 4197 Jan 23 20:16 sys/src/cmd/vnc/wsys.c
	/n/sourcesdump/2006/0123/plan9/sys/src/cmd/vnc/wsys.c:147,154 - 
	/n/sourcesdump/2006/0124/plan9/sys/src/cmd/vnc/wsys.c:147,160
	  				m.xy.y = atoi(start+1+12);
	  				m.buttons = atoi(start+1+2*12) & 0x1F;
	  				m.xy = subpt(m.xy, screen->r.min);
	- 				if(ptinrect(m.xy, Rpt(ZP, v->dim)))
	+ 				if(ptinrect(m.xy, Rpt(ZP, v->dim))){
	  					mouseevent(v, m);
	+ 					/* send wheel button *release* */ 
	+ 					if ((m.buttons & 0x7) != m.buttons) {
	+ 						m.buttons &= 0x7;
	+ 						mouseevent(v, m);
	+ 					}
	+ 				}
	  			} else
	  				eresized();
	  


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].