avoided mktemp in auxstorage

This commit is contained in:
jiri committed 2026-10-26 13:39:01 +01:00
1 parent 868c0449b9
commit b47e61a061
1 file changed
+4 -6
+4 -6
View File
@@ -59,12 +59,10 @@ public:
template<typename T> template<typename T>
AuxStorage<T>::AuxStorage(void) AuxStorage<T>::AuxStorage(void)
{ {
//mkstemp probable does not support O_LARGEFILE?! //mkostemp creates and opens the file atomically (unlike mktemp+open), additional flags like O_LARGEFILE can be given
strcpy(filename,"AUX_XXXXXX"); strcpy(filename,"AUX_XXXXXX");
mktemp(filename); fd=mkostemp(filename,O_LARGEFILE);
unlink(filename); if(fd<0) {perror(""); laerror("mkostemp failed in AuxStorage");}
fd=open(filename,O_CREAT|O_LARGEFILE|O_RDWR,0777);
if(fd<0) {perror(""); laerror("open failed in AuxStorage");}
recl=0; recl=0;
deleteme=1; deleteme=1;
} }