fixed lockfile trying to lock already locked file
This commit is contained in:
@ -837,16 +837,16 @@ int lockFile(const char* pathname) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isOpen(pathname, O_LOCK)){ // file is already locked
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int existing = 0;
|
int existing = 0;
|
||||||
if(isOpen(pathname, 0)){ // file is already open
|
if(isOpen(pathname, 0)){ // file is already open
|
||||||
existing = 1;
|
existing = 1;
|
||||||
goto _unlockFile;
|
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
|
if (openFile(pathname, O_LOCK) == 0) // open the file with the lock
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user