From b47e61a0615468649fc629d853105ca62de5cd74 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Mon, 26 Oct 2026 13:39:01 +0100 Subject: [PATCH] avoided mktemp in auxstorage --- auxstorage.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/auxstorage.h b/auxstorage.h index 0ea219b..7029278 100644 --- a/auxstorage.h +++ b/auxstorage.h @@ -59,12 +59,10 @@ public: template AuxStorage::AuxStorage(void) { -//mkstemp probable does not support O_LARGEFILE?! -strcpy(filename,"AUX_XXXXXX"); -mktemp(filename); -unlink(filename); -fd=open(filename,O_CREAT|O_LARGEFILE|O_RDWR,0777); -if(fd<0) {perror(""); laerror("open failed in AuxStorage");} +//mkostemp creates and opens the file atomically (unlike mktemp+open), additional flags like O_LARGEFILE can be given +strcpy(filename,"AUX_XXXXXX"); +fd=mkostemp(filename,O_LARGEFILE); +if(fd<0) {perror(""); laerror("mkostemp failed in AuxStorage");} recl=0; deleteme=1; }