Browse Source

Plan 9 from Bell Labs 2008-10-07

David du Colombier 12 years ago
parent
commit
6414512c11

+ 5 - 3
dist/replica/_plan9.db

@@ -8204,7 +8204,7 @@ sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1216677181 4912
 sys/src/9/pc/usb.h - 664 sys sys 1202865355 4630
-sys/src/9/pc/usbohci.c - 664 sys sys 1218342331 48280
+sys/src/9/pc/usbohci.c - 664 sys sys 1223321671 48291
 sys/src/9/pc/usbuhci.c - 664 sys sys 1218342383 31740
 sys/src/9/pc/vga.c - 664 sys sys 1131290595 5148
 sys/src/9/pc/vga3dfx.c - 664 sys sys 1133218367 3833
@@ -10322,7 +10322,7 @@ sys/src/cmd/dossrv/dat.h - 664 sys sys 1017679316 5376
 sys/src/cmd/dossrv/devio.c - 664 sys sys 1017679315 1122
 sys/src/cmd/dossrv/dosfs.c - 664 sys sys 1143759346 17008
 sys/src/cmd/dossrv/dosfs.h - 664 sys sys 1014925385 160
-sys/src/cmd/dossrv/dossubs.c - 664 sys sys 1143289669 37706
+sys/src/cmd/dossrv/dossubs.c - 664 sys sys 1223320904 38108
 sys/src/cmd/dossrv/errstr.h - 664 sys sys 1014925385 544
 sys/src/cmd/dossrv/fns.h - 664 sys sys 1014925385 1989
 sys/src/cmd/dossrv/iotrack.c - 664 sys sys 1014925385 5153
@@ -14273,7 +14273,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1188509396 1075
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1188509396 20717
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1188509396 1356
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1204179355 33414
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1223322786 33455
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1201499389 1134
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1181508390 6924
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1139699502 10238
@@ -15883,3 +15883,5 @@ 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 1020896385 0
+386/bin/dossrv - 775 sys sys 1223348950 136682
+386/bin/upas/smtpd - 775 sys sys 1223348950 336055

+ 5 - 5
dist/replica/plan9.db

@@ -223,7 +223,7 @@
 386/bin/disk/partfs - 775 sys sys 1210392664 150017
 386/bin/disk/prep - 775 sys sys 1223060923 96250
 386/bin/disk/sacfs - 775 sys sys 1020319075 79882
-386/bin/dossrv - 775 sys sys 1209614265 136548
+386/bin/dossrv - 775 sys sys 1223348950 136682
 386/bin/du - 775 sys sys 1215633035 76279
 386/bin/echo - 775 sys sys 1168402304 57592
 386/bin/ecp - 775 sys sys 1179777651 72588
@@ -482,7 +482,7 @@
 386/bin/upas/scanmail - 775 sys sys 1209614764 128224
 386/bin/upas/send - 775 sys sys 1210648938 192191
 386/bin/upas/smtp - 775 sys sys 1210393023 277548
-386/bin/upas/smtpd - 775 sys sys 1214510171 336053
+386/bin/upas/smtpd - 775 sys sys 1223348950 336055
 386/bin/upas/spam - 775 sys sys 1064598366 36
 386/bin/upas/testscan - 775 sys sys 1209614790 83875
 386/bin/upas/token - 775 sys sys 1188447329 73042
@@ -8204,7 +8204,7 @@ sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1216677181 4912
 sys/src/9/pc/usb.h - 664 sys sys 1202865355 4630
-sys/src/9/pc/usbohci.c - 664 sys sys 1218342331 48280
+sys/src/9/pc/usbohci.c - 664 sys sys 1223321671 48291
 sys/src/9/pc/usbuhci.c - 664 sys sys 1218342383 31740
 sys/src/9/pc/vga.c - 664 sys sys 1131290595 5148
 sys/src/9/pc/vga3dfx.c - 664 sys sys 1133218367 3833
@@ -10322,7 +10322,7 @@ sys/src/cmd/dossrv/dat.h - 664 sys sys 1017679316 5376
 sys/src/cmd/dossrv/devio.c - 664 sys sys 1017679315 1122
 sys/src/cmd/dossrv/dosfs.c - 664 sys sys 1143759346 17008
 sys/src/cmd/dossrv/dosfs.h - 664 sys sys 1014925385 160
-sys/src/cmd/dossrv/dossubs.c - 664 sys sys 1143289669 37706
+sys/src/cmd/dossrv/dossubs.c - 664 sys sys 1223320904 38108
 sys/src/cmd/dossrv/errstr.h - 664 sys sys 1014925385 544
 sys/src/cmd/dossrv/fns.h - 664 sys sys 1014925385 1989
 sys/src/cmd/dossrv/iotrack.c - 664 sys sys 1014925385 5153
@@ -14273,7 +14273,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1188509396 1075
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1188509396 20717
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1188509396 1356
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1204179355 33414
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1223322786 33455
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1201499389 1134
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1181508390 6924
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1139699502 10238

+ 6 - 0
dist/replica/plan9.log

@@ -36151,3 +36151,9 @@
 1223004604 0 c sys/man/8/prep - 664 sys sys 1223003502 14382
 1223004604 1 c sys/src/cmd/disk/prep/prep.c - 664 sys sys 1223003493 10203
 1223062204 0 c 386/bin/disk/prep - 775 sys sys 1223060923 96250
+1223321404 0 c sys/src/9/pc/usbohci.c - 664 sys sys 1223320689 48302
+1223321404 1 c sys/src/cmd/dossrv/dossubs.c - 664 sys sys 1223320904 38108
+1223323204 0 c sys/src/9/pc/usbohci.c - 664 sys sys 1223321671 48291
+1223323204 1 c sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1223322786 33455
+1223350205 0 c 386/bin/dossrv - 775 sys sys 1223348950 136682
+1223350205 1 c 386/bin/upas/smtpd - 775 sys sys 1223348950 336055

+ 8 - 6
sys/src/9/pc/usbohci.c

@@ -856,7 +856,7 @@ eptactivate(Ctlr *ub, Endpt *ep)
 		case Nomode:
 			break;
 		default:
-			panic("eptactivate: wierd epmode %d\n", ep->epmode);
+			panic("eptactivate: wierd epmode %d", ep->epmode);
 		}
 		ep->dir[Dirin].xdone  = ep->dir[Dirin].xstarted =  0;
 		ep->dir[Dirout].xdone = ep->dir[Dirout].xstarted = 0;
@@ -903,7 +903,7 @@ EDpullfromctl(Ctlr *ub, ED *ed)
 		this = EDgetnext(this);
 	}
 	if(this == nil)
-		panic("EDpullfromctl: not found\n");
+		panic("EDpullfromctl: not found");
 	next = EDgetnext(this);
 	if(prev == nil)
 		OHCIsetControlHeadED(ub->base, next);
@@ -979,7 +979,7 @@ eptdeactivate(Ctlr *ub, Endpt *ep)
 		case Nomode:
 			break;
 		default:
-			panic("eptdeactivate: wierd in.epmode %d\n",
+			panic("eptdeactivate: wierd in.epmode %d",
 				ep->epmode);
 		}
 	}
@@ -1003,7 +1003,7 @@ kickappropriatequeue(Ctlr *ub, Endpt *ep, int)
 		/* no kicking required */
 		break;
 	default:
-		panic("wierd epmode %d\n", ep->epmode);
+		panic("wierd epmode %d", ep->epmode);
 	}
 }
 
@@ -1847,7 +1847,7 @@ interrupt(Ureg *, void *arg)
 			wakeup(&ep->dir[dirin].rend);
 			break;
 		default:
-			panic("cc %ud unimplemented\n", cc);
+			panic("cc %ud unimplemented", cc);
 		}
 		ep->dir[dirin].queued--;
 		/* Clean up blocks used for transfers */
@@ -2042,8 +2042,10 @@ write(Usbhost *uh, Endpt *ep, void *a, long n, vlong off, int tok)
 		dcclean(b->rp, m);
 		if(ep->epmode == Isomode && ep->buffered <= ep->bw<<1){
 			sleep(&ep->dir[Dirout].rend, weptdone, ep);
-			if(ep->dir[Dirout].err)
+			if(ep->dir[Dirout].err) {
+				freeb(b);
 				error(ep->dir[Dirout].err);
+			}
 		}
 		while(m > 0){
 			int l;

+ 12 - 2
sys/src/cmd/dossrv/dossubs.c

@@ -13,7 +13,7 @@ int
 isdosfs(uchar *buf)
 {
 	/*
-	 * When dynamic disc managers move the disc partition, 
+	 * When dynamic disc managers move the disc partition,
 	 * they make it start with 0xE9.
 	 */
 	if(buf[0] == 0xE9)
@@ -21,9 +21,17 @@ isdosfs(uchar *buf)
 
 	/*
 	 * Check if the jump displacement (magic[1]) is too short for a FAT.
+	 *
+	 * check now omitted due to digital cameras that use a 0 jump.
+	 * the ecma-107 standard says this is okay and that interoperable fat
+	 * implementations shouldn't assume this:
+	 * http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-107.pdf,
+	 * page 11.
 	 */
-	if(buf[0] == 0xEB && buf[2] == 0x90 && buf[1] >= 0x30)
+	if(buf[0] == 0xEB && buf[2] == 0x90 /* && buf[1] >= 0x30 */)
 		return 1;
+	if(chatty)
+		fprint(2, "bad sig %.2ux %.2ux %.2uxn", buf[0], buf[1], buf[2]);
 
 	return 0;
 }
@@ -101,6 +109,8 @@ dosfs(Xfs *xf)
 		bp->fatsize = GLONG(b32->fatsize32);
 		if(bp->fatsize == 0){
 			putsect(p);
+			if(chatty)
+				fprint(2, "fatsize 0\n");
 			return -1;
 		}
 		bp->dataaddr = bp->fataddr + bp->nfats*bp->fatsize;

+ 7 - 1
sys/src/cmd/upas/smtp/smtpd.c

@@ -718,6 +718,8 @@ getcrnl(String *s, Biobuf *fp)
 			fprint(2, "%c", c);
 		}
 		switch(c){
+		case 0:
+			break;
 		case -1:
 			goto out;
 		case '\r':
@@ -1118,8 +1120,12 @@ pipemsg(int *byteswritten)
 			sawdot = 1;
 			break;
 		}
+		if(cp[0] == '.'){
+			cp++;
+			n--;
+		}
 		nbytes += n;
-		if(status == 0 && Bwrite(pp->std[0]->fp, *cp == '.' ? cp+1 : cp, n) < 0){
+		if(status == 0 && Bwrite(pp->std[0]->fp, cp, n) < 0){
 			piperror = "write error 3";
 			status = 1;
 		}