Skip to content
Snippets Groups Projects
Commit b9fe6679 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use sopen(... SH_DENYRW) for fmutex() instead of open()

O_EXCL doesn't appear to be working very reliably over Samba, so let's add
file locking to the equation.
parent af159fec
Branches
Tags
No related merge requests found
Pipeline #7157 passed
......@@ -129,7 +129,7 @@ bool fmutex(const char* fname, const char* text, long max_age, time_t* tp)
return false;
}
}
if((file=open(fname,O_CREAT|O_WRONLY|O_EXCL,DEFFILEMODE))<0)
if((file=sopen(fname, O_CREAT|O_WRONLY|O_EXCL, SH_DENYRW, DEFFILEMODE))<0)
return false;
if(text!=NULL)
result = write(file,text,strlen(text)) >= 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment