aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c
index 1ca797f7..3552189c 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -55,9 +55,7 @@ char *__ILWS_tmpfname() {
55 if(tmpdir==NULL) { 55 if(tmpdir==NULL) {
56 tmpdir=P_tmpdir; // defined in stdio.h 56 tmpdir=P_tmpdir; // defined in stdio.h
57 }; 57 };
58 IFDEBUG(fprintf(stderr,"utils.c: Allocating temporary file name: "));
59 if(!(ret=__ILWS_malloc(strlen(tmpdir)+strlen(_tmpnameprefix)+TMPNAMESIZE+2))) { 58 if(!(ret=__ILWS_malloc(strlen(tmpdir)+strlen(_tmpnameprefix)+TMPNAMESIZE+2))) {
60 LWSERR(LE_MEMORY);
61 return NULL; 59 return NULL;
62 }; 60 };
63 srand(time(NULL)); // seed 61 srand(time(NULL)); // seed
@@ -68,7 +66,6 @@ char *__ILWS_tmpfname() {
68 } 66 }
69 nam[i]=0; 67 nam[i]=0;
70 snprintf(ret,strlen(tmpdir)+strlen(_tmpnameprefix)+TMPNAMESIZE+2,"%s/%s%s",tmpdir,_tmpnameprefix,nam); // include '0' 68 snprintf(ret,strlen(tmpdir)+strlen(_tmpnameprefix)+TMPNAMESIZE+2,"%s/%s%s",tmpdir,_tmpnameprefix,nam); // include '0'
71 IFDEBUG(fprintf(stderr,"Temporary filename is: %s, stat:%d\n",ret,stat(ret,&foostat)));
72 }while((stat(ret,&foostat)!=-1) && (lstat(ret,&foostat)!=-1)); // redundancy if win32 // <- race condition? 69 }while((stat(ret,&foostat)!=-1) && (lstat(ret,&foostat)!=-1)); // redundancy if win32 // <- race condition?
73 return ret; 70 return ret;
74}; 71};