remove temp files on close
diff --git a/src/lib9/opentemp.c b/src/lib9/opentemp.c
index ff2b3f8..f90bf77 100644
--- a/src/lib9/opentemp.c
+++ b/src/lib9/opentemp.c
@@ -4,6 +4,12 @@
 int
 opentemp(char *template)
 {
-	return mkstemp(template);
+	int fd;
+
+	fd = mkstemp(template);
+	if(fd < 0)
+		return -1;
+	remove(template);
+	return fd;
 }