Browse Source

Plan 9 from Bell Labs 2010-01-12

David du Colombier 14 years ago
parent
commit
98ff8561b2

+ 1 - 0
sys/games/lib/fortunes

@@ -4264,3 +4264,4 @@ Sharing your DNA hasn't been this exciting since the good old days. - Genealogy.
 *WASH_Eyes_outWith_soap*
 -rwxr-xr-x  1 rae rae 141307906 Nov 10 16:55 arm-2009q3-67-arm-none-linux-gnueabi.bin  # shell script
 Beam to 1.04TeV... Lost due to tune drifting [sh*t!]... Tunes for beam 1 were different when we returned to injection energy (no precycle)... Trimmed and incorporated... Ramped 2 beams, all the way to 1.18TeV !!
+anguish up -1 days, 00:00:01

+ 1 - 1
sys/lib/newuser

@@ -8,7 +8,7 @@ if(test -f $home/lib/profile){
 }
 cd $home
 x='$'
-mkdir bin bin/rc bin/mips bin/386
+mkdir bin bin/rc bin/mips bin/386 bin/power bin/arm
 mkdir lib tmp
 chmod +t tmp
 bind -c $home/tmp /tmp

+ 1 - 1
sys/src/9/ip/icmp.c

@@ -347,7 +347,7 @@ icmpiput(Proto *icmp, Ipifc*, Block *bp)
 		goto raise;
 	}
 	iplen = nhgets(p->length);
-	if(iplen > n || (iplen % 1)){
+	if(iplen > n){
 		ipriv->stats[LenErrs]++;
 		ipriv->stats[InErrors]++;
 		netlog(icmp->f, Logicmp, "icmp length %d\n", iplen);

+ 1 - 1
sys/src/9/ip/icmp6.c

@@ -572,7 +572,7 @@ valid(Proto *icmp, Ipifc *ifc, Block *bp, Icmppriv6 *ipriv)
 	}
 
 	iplen = nhgets(p->ploadlen);
-	if(iplen > n - IP6HDR || (iplen % 1) != 0) {
+	if(iplen > n - IP6HDR) {
 		ipriv->stats[LenErrs6]++;
 		netlog(icmp->f, Logicmp, "icmp length %d\n", iplen);
 		goto err;

+ 4 - 0
sys/src/9/pc/kbd.c

@@ -249,7 +249,10 @@ i8042auxcmd(int cmd)
 {
 	unsigned int c;
 	int tries;
+	static int badkbd;
 
+	if(badkbd)
+		return -1;
 	c = 0;
 	tries = 0;
 
@@ -273,6 +276,7 @@ i8042auxcmd(int cmd)
 
 	if(c != 0xFA){
 		print("i8042: %2.2ux returned to the %2.2ux command\n", c, cmd);
+		badkbd = 1;	/* don't keep trying; there might not be one */
 		return -1;
 	}
 	return 0;

+ 13 - 3
sys/src/cmd/rc/plan9.c

@@ -303,6 +303,7 @@ Updenv(void)
 		updenvlocal(runq->local);
 }
 
+/* not used on plan 9 */
 int
 ForkExecute(char *file, char **argv, int sin, int sout, int serr)
 {
@@ -336,9 +337,11 @@ void
 Execute(word *args, word *path)
 {
 	char **argv = mkargv(args);
-	char file[1024];
+	char file[1024], errstr[1024];
 	int nc;
+
 	Updenv();
+	errstr[0] = '\0';
 	for(;path;path = path->next){
 		nc = strlen(path->word);
 		if(nc < sizeof file - 1){	/* 1 for / */
@@ -350,12 +353,19 @@ Execute(word *args, word *path)
 			if(nc + strlen(argv[1]) < sizeof file){
 				strcat(file, argv[1]);
 				exec(file, argv+1);
+				rerrstr(errstr, sizeof errstr);
+				/*
+				 * if file is executable, exec should have
+				 * worked.  stop searching and print the
+				 * reason for failure.
+				 */
+				if (access(file, AEXEC) == 0)
+					break;
 			}
 			else werrstr("command name too long");
 		}
 	}
-	rerrstr(file, sizeof file);
-	pfmt(err, "%s: %s\n", argv[1], file);
+	pfmt(err, "%s: %s\n", argv[1], errstr);
 	efree((char *)argv);
 }
 #define	NDIR	256		/* shoud be a better way */

+ 6 - 3
sys/src/libc/9sys/convS2M.c

@@ -15,10 +15,13 @@ pstring(uchar *p, char *s)
 	}
 
 	n = strlen(s);
+	/*
+	 * We are moving the string before the length,
+	 * so you can S2M a struct into an existing message
+	 */
+	memmove(p + BIT16SZ, s, n);
 	PBIT16(p, n);
-	p += BIT16SZ;
-	memmove(p, s, n);
-	p += n;
+	p += n + BIT16SZ;
 	return p;
 }