lockfile: Remove force parameter from hold_lock()
If user wants to 'force' a lock, he/she will have to remove the file manually. some wierd race conditions may happen if different processes optains the same lock at any given time (thats why lockfile is implemented in the first place) So lockfile API should not in any circumstances directly provide a way to force taking a lock.
This commit is contained in:
parent
c731173b49
commit
697d512ea6
5 changed files with 9 additions and 16 deletions
|
|
@ -163,7 +163,7 @@ int proc_cache_open() {
|
|||
"%s/%s", env_get_dir(), STORAGE_FILE);
|
||||
|
||||
/* try lockin the file */
|
||||
if (hold_lock(&lock, filename, 0) < 0)
|
||||
if (hold_lock(&lock, filename) < 0)
|
||||
goto error;
|
||||
|
||||
fd = open(filename, O_CREAT | O_RDONLY, 0600);
|
||||
|
|
|
|||
Reference in a new issue