Commit Diff


commit - 005ee04b9f6484c1831c655fcfb246424919fca1
commit + 3f23048f7b69bd4018939ad608797e818828e871
blob - ff2b3f81bf90aea651c4a922c21fbf5136108e6e
blob + f90bf771b67e5a0b18c94065c930368dd3f9c236
--- src/lib9/opentemp.c
+++ 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;
 }