27 lines
808 B
Plaintext
27 lines
808 B
Plaintext
$NetBSD: patch-al,v 1.2 2008/08/12 20:09:34 tonnerre Exp $
|
|
|
|
--- wml_backend/p3_eperl/eperl_sys.c.orig 2002-08-08 23:56:26.000000000 +0200
|
|
+++ wml_backend/p3_eperl/eperl_sys.c
|
|
@@ -211,13 +211,20 @@ char *mytmpfile(char *id)
|
|
{
|
|
char ca[1024];
|
|
char *cp, *tmpdir;
|
|
+ char tmpfile[]="eperl_sourceXXXXXX";
|
|
int i;
|
|
+ int fd=-1;
|
|
|
|
tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == (char *) NULL)
|
|
tmpdir="/tmp";
|
|
|
|
- snprintf(ca, sizeof(ca), "%s/%s.%d.tmp%d", tmpdir, id, (int)getpid(), mytmpfilecnt++);
|
|
+ snprintf(ca, sizeof(ca), "%s/%s", tmpdir, tmpfile);
|
|
+ if((fd = mkstemp(tmpfile)) == -1){
|
|
+ perror("can not create tmpfile");
|
|
+ return NULL;
|
|
+ }
|
|
+ close(fd);
|
|
ca[sizeof(ca)-1] = NUL;
|
|
cp = strdup(ca);
|
|
for (i = 0; mytmpfiles[i] != NULL; i++)
|