openbsd-ports/misc/xtar/patches/patch-common_tmpfile_c

18 lines
493 B
Plaintext
Raw Normal View History

2007-10-26 18:00:31 -04:00
$OpenBSD: patch-common_tmpfile_c,v 1.1 2007/10/26 22:00:31 ajacoutot Exp $
2000-06-06 18:31:53 -04:00
--- common/tmpfile.c.orig Tue May 9 10:06:46 1995
2007-10-26 18:00:31 -04:00
+++ common/tmpfile.c Fri Oct 26 23:58:56 2007
2000-06-06 18:31:53 -04:00
@@ -90,7 +90,12 @@ void tmpfile_free()
2000-04-15 20:59:08 -04:00
char *tmpfile_create()
{
TMP_FILE *ptr, *tf;
- char *filename = strdup(tmpnam(NULL));
+ char xxx[40];
+ char *filename;
+
+ sprintf(xxx, "/tmp/tmpf.XXXXXXXX");
+ close(mkstemp(xxx));
+ filename = strdup(xxx);
2000-04-15 20:59:08 -04:00
if(filename == NULL)
return(NULL);