Add the #goo to allow use in C++.
Silence a few more warnings.
Strip down the mkfiles more.
Fix bug in X11 mouse handling, note groups.
diff --git a/src/cmd/idiff.c b/src/cmd/idiff.c
index c3f207f..1dc49cf 100644
--- a/src/cmd/idiff.c
+++ b/src/cmd/idiff.c
@@ -82,11 +82,14 @@
 opentemp(char *template, int mode, long perm)
 {
 	int fd;
+	Dir d;
 
 	fd = mkstemp(template);
 	if(fd < 0)
 		sysfatal("could not create temporary file");
-	fchmod(fd, perm);
+	nulldir(&d);
+	d.mode = perm;
+	dirfwstat(fd, &d);
 
 	return fd;
 }
diff --git a/src/cmd/mkfile b/src/cmd/mkfile
index b34a61b..0f0ab11 100644
--- a/src/cmd/mkfile
+++ b/src/cmd/mkfile
@@ -6,7 +6,7 @@
 
 <$PLAN9/src/mkmany
 
-BUGGERED='CVS|oplumb|plumb|plumb2|mk|vac|9term'
+BUGGERED='CVS|oplumb|plumb|plumb2|mk|vac|9term|venti'
 DIRS=`ls -l |sed -n 's/^d.* //p' |egrep -v "$BUGGERED"`
 
 <$PLAN9/src/mkdirs
diff --git a/src/cmd/sam/sam.c b/src/cmd/sam/sam.c
index 4f774a9..078d943 100644
--- a/src/cmd/sam/sam.c
+++ b/src/cmd/sam/sam.c
@@ -141,6 +141,7 @@
 	File *f;
 	char *c;
 	char buf[256];
+	char *root;
 
 	if(rescuing++)
 		return;
@@ -162,7 +163,10 @@
 			free(c);
 		}else
 			sprint(buf, "nameless.%d", nblank++);
-		fprint(io, "#!%s '%s' $* <<'---%s'\n", SAMSAVECMD, buf, buf);
+		root = getenv("PLAN9");
+		if(root == nil)
+			root = "/usr/local/plan9";
+		fprint(io, "#!/bin/sh\n%s/bin/samsave '%s' $* <<'---%s'\n", root, buf, buf);
 		addr.r.p1 = 0, addr.r.p2 = f->b.nc;
 		writeio(f);
 		fprint(io, "\n---%s\n", (char *)buf);
diff --git a/src/cmd/sam/sam.h b/src/cmd/sam/sam.h
index 7e824da..1e92c73 100644
--- a/src/cmd/sam/sam.h
+++ b/src/cmd/sam/sam.h
@@ -345,7 +345,6 @@
 extern char	SHPATH[];
 extern char	RX[];
 extern char	RXPATH[];
-extern char	SAMSAVECMD[];
 
 /*
  * acme globals
diff --git a/src/cmd/sam/unix.c b/src/cmd/sam/unix.c
index 024d308..45cfc3b 100644
--- a/src/cmd/sam/unix.c
+++ b/src/cmd/sam/unix.c
@@ -38,9 +38,6 @@
 #ifndef RXPATHNAME
 #define RXPATHNAME "ssh"
 #endif
-#ifndef SAMSAVECMDNAME
-#define SAMSAVECMDNAME "/bin/sh\n/usr/local/plan9/bin/samsave"
-#endif
 
 char	RSAM[] = "sam";
 char	SAMTERM[] = SAMTERMNAME;
@@ -50,7 +47,6 @@
 char	SHPATH[] = SHPATHNAME;
 char	RX[] = RXNAME;
 char	RXPATH[] = RXPATHNAME;
-char	SAMSAVECMD[] = SAMSAVECMDNAME;
 
 
 void
diff --git a/src/cmd/unutf.c b/src/cmd/unutf.c
index c161731..0be7aa8 100644
--- a/src/cmd/unutf.c
+++ b/src/cmd/unutf.c
@@ -1,3 +1,7 @@
+/*
+ * stupid little program to pipe unicode chars through 
+ * when converting to non-utf compilers.
+ */
 #include <u.h>
 #include <libc.h>
 #include <bio.h>