Browse Source

Plan 9 from Bell Labs 2008-06-06

David du Colombier 13 years ago
parent
commit
d022f7d570

+ 3 - 3
dist/replica/_plan9.db

@@ -500,7 +500,7 @@
 386/bin/vac - 775 sys sys 1196742539 171330
 386/bin/vacfs - 775 sys sys 1196742542 176138
 386/bin/venti - 20000000775 sys sys 947360466 0
-386/bin/venti/buildindex - 775 sys sys 1211255650 259435
+386/bin/venti/buildindex - 775 sys sys 1212695266 259494
 386/bin/venti/checkarenas - 775 sys sys 1211255666 261314
 386/bin/venti/checkindex - 775 sys sys 1211255671 256744
 386/bin/venti/clumpstats - 775 sys sys 1211255677 245680
@@ -14229,7 +14229,7 @@ sys/src/cmd/upas/ml/mlmgr.c - 664 sys sys 1045505888 2332
 sys/src/cmd/upas/ml/mlowner.c - 664 sys sys 1177589086 1143
 sys/src/cmd/upas/ned - 20000000775 sys sys 1062073146 0
 sys/src/cmd/upas/ned/mkfile - 664 sys sys 1060041738 233
-sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1210371064 44554
+sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1212691953 44795
 sys/src/cmd/upas/pop3 - 20000000775 sys sys 1064589604 0
 sys/src/cmd/upas/pop3/mkfile - 664 sys sys 1064589604 186
 sys/src/cmd/upas/pop3/pop3.c - 664 sys sys 1115039848 14327
@@ -14374,7 +14374,7 @@ sys/src/cmd/venti/srv/arena.c - 664 sys sys 1207253133 20156
 sys/src/cmd/venti/srv/arenas.c - 664 sys sys 1211224670 8048
 sys/src/cmd/venti/srv/bloom.c - 664 sys sys 1196369124 4445
 sys/src/cmd/venti/srv/buildbuck.c - 664 sys sys 1177189435 2837
-sys/src/cmd/venti/srv/buildindex.c - 664 sys sys 1191257306 21645
+sys/src/cmd/venti/srv/buildindex.c - 664 sys sys 1212642437 21703
 sys/src/cmd/venti/srv/checkarenas.c - 664 sys sys 1191257304 2310
 sys/src/cmd/venti/srv/checkindex.c - 664 sys sys 1179342633 5978
 sys/src/cmd/venti/srv/clump.c - 664 sys sys 1191257297 5316

+ 3 - 3
dist/replica/plan9.db

@@ -500,7 +500,7 @@
 386/bin/vac - 775 sys sys 1196742539 171330
 386/bin/vacfs - 775 sys sys 1196742542 176138
 386/bin/venti - 20000000775 sys sys 947360466 0
-386/bin/venti/buildindex - 775 sys sys 1211255650 259435
+386/bin/venti/buildindex - 775 sys sys 1212695266 259494
 386/bin/venti/checkarenas - 775 sys sys 1211255666 261314
 386/bin/venti/checkindex - 775 sys sys 1211255671 256744
 386/bin/venti/clumpstats - 775 sys sys 1211255677 245680
@@ -14229,7 +14229,7 @@ sys/src/cmd/upas/ml/mlmgr.c - 664 sys sys 1045505888 2332
 sys/src/cmd/upas/ml/mlowner.c - 664 sys sys 1177589086 1143
 sys/src/cmd/upas/ned - 20000000775 sys sys 1062073146 0
 sys/src/cmd/upas/ned/mkfile - 664 sys sys 1060041738 233
-sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1210371064 44554
+sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1212691953 44795
 sys/src/cmd/upas/pop3 - 20000000775 sys sys 1064589604 0
 sys/src/cmd/upas/pop3/mkfile - 664 sys sys 1064589604 186
 sys/src/cmd/upas/pop3/pop3.c - 664 sys sys 1115039848 14327
@@ -14374,7 +14374,7 @@ sys/src/cmd/venti/srv/arena.c - 664 sys sys 1207253133 20156
 sys/src/cmd/venti/srv/arenas.c - 664 sys sys 1211224670 8048
 sys/src/cmd/venti/srv/bloom.c - 664 sys sys 1196369124 4445
 sys/src/cmd/venti/srv/buildbuck.c - 664 sys sys 1177189435 2837
-sys/src/cmd/venti/srv/buildindex.c - 664 sys sys 1191257306 21645
+sys/src/cmd/venti/srv/buildindex.c - 664 sys sys 1212642437 21703
 sys/src/cmd/venti/srv/checkarenas.c - 664 sys sys 1191257304 2310
 sys/src/cmd/venti/srv/checkindex.c - 664 sys sys 1179342633 5978
 sys/src/cmd/venti/srv/clump.c - 664 sys sys 1191257297 5316

+ 3 - 0
dist/replica/plan9.log

@@ -19828,3 +19828,6 @@
 1212433204 2 c sys/src/cmd/acme/elog.c - 664 sys sys 1212432645 7429
 1212465604 0 c 386/bin/acme - 775 sys sys 1212463885 432067
 1212598803 0 d 386/bin/auth/secretpem - 775 sys sys 1045537944 0
+1212643806 0 c sys/src/cmd/venti/srv/buildindex.c - 664 sys sys 1212642437 21703
+1212692406 0 c sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1212691953 44795
+1212696005 0 c 386/bin/venti/buildindex - 775 sys sys 1212695266 259494

+ 29 - 21
sys/src/cmd/upas/ned/nedmail.c

@@ -765,7 +765,7 @@ snprintheader(char *buf, int len, Message *m)
 {
 	char timebuf[32];
 	String *id;
-	char *p, *q;;
+	char *p, *q;
 
 	// create id
 	id = s_new();
@@ -1758,35 +1758,38 @@ tokenize822(char *str, char **args, int max)
 		}
 }
 
+/* return reply-to address & set *nmp to corresponding Message */
+static char *
+getreplyto(Message *m, Message **nmp)
+{
+	Message *nm;
+
+	for(nm = m; nm != ⊤ nm = nm->parent)
+ 		if(*nm->replyto != 0)
+			break;
+	*nmp = nm;
+	return nm? nm->replyto: nil;
+}
+
 Message*
 rcmd(Cmd *c, Message *m)
 {
+	char *addr;
 	char *av[128];
 	int i, ai = 1;
+	String *from, *rpath, *path = nil, *subject = nil;
 	Message *nm;
-	char *addr;
-	String *path = nil;
-	String *rpath;
-	String *subject = nil;
-	String *from;
 
 	if(m == &top){
 		Bprint(&out, "!address\n");
 		return nil;
 	}
 
-	addr = nil;
-	for(nm = m; nm != ⊤ nm = nm->parent){
- 		if(*nm->replyto != 0){
-			addr = nm->replyto;
-			break;
-		}
-	}
+	addr = getreplyto(m, &nm);
 	if(addr == nil){
 		Bprint(&out, "!no reply address\n");
 		return nil;
 	}
-
 	if(nm == &top){
 		print("!noone to reply to\n");
 		return nil;
@@ -1796,7 +1799,7 @@ rcmd(Cmd *c, Message *m)
 		if(*nm->subject){
 			av[ai++] = "-s";
 			subject = addrecolon(nm->subject);
-			av[ai++] = s_to_c(subject);;
+			av[ai++] = s_to_c(subject);
 			break;
 		}
 	}
@@ -1881,21 +1884,25 @@ Message*
 acmd(Cmd *c, Message *m)
 {
 	char *av[128];
-	int i, ai;
-	String *from, *to, *cc, *path = nil, *subject = nil;
+	int i, ai = 1;
+	String *from, *rpath, *path = nil, *subject = nil;
+	String *to, *cc;
 
 	if(m == &top){
 		Bprint(&out, "!address\n");
 		return nil;
 	}
 
-	ai = 1;
 	if(*m->subject){
 		av[ai++] = "-s";
 		subject = addrecolon(m->subject);
 		av[ai++] = s_to_c(subject);
 	}
 
+	av[ai++] = "-R";
+	rpath = rooted(s_clone(m->path));
+	av[ai++] = s_to_c(rpath);
+
 	if(strchr(c->av[0], 'A') != nil){
 		av[ai++] = "-t";
 		av[ai++] = "message/rfc822";
@@ -1914,12 +1921,13 @@ acmd(Cmd *c, Message *m)
 	ai += tokenize822(s_to_c(cc), &av[ai], nelem(av) - ai);
 	av[ai] = 0;
 	if(tomailer(av) < 0)
-		return nil;
+		m = nil;
+	s_free(path);
+	s_free(rpath);
+	s_free(subject);
 	s_free(from);
 	s_free(to);
 	s_free(cc);
-	s_free(subject);
-	s_free(path);
 	return m;
 }
 

+ 2 - 0
sys/src/cmd/venti/srv/buildindex.c

@@ -811,6 +811,8 @@ isectproc(void *v)
 			sysfatal("not enough memory");
 		nminibuf = nbuf;
 	}
+	if (nbuf == 0)
+		sysfatal("zero nbuf; isect too small");
 	/* size buffer to use extra memory */
 	bufsize = MinBufSize;
 	while(bufsize*2*nbuf <= isectmem && bufsize < MaxBufSize)