fixed lockfile trying to lock already locked file

This commit is contained in:
elvis
2022-05-05 21:13:32 +02:00
parent 15ab8f44d0
commit 1a20f374f1

View File

@ -837,16 +837,16 @@ int lockFile(const char* pathname) {
return -1;
}
if(isOpen(pathname, O_LOCK)){ // file is already locked
return 0;
}
int existing = 0;
if(isOpen(pathname, 0)){ // file is already open
existing = 1;
goto _unlockFile;
}
if(isOpen(pathname, O_LOCK)){ // file is already locked
return 0;
}
if (openFile(pathname, O_LOCK) == 0) // open the file with the lock
return 0;