Archived
1
0
Fork 0

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:
Henrik Hautakoski 2013-10-17 15:57:42 +02:00
parent c731173b49
commit 697d512ea6
5 changed files with 9 additions and 16 deletions

View file

@ -245,7 +245,7 @@ int dlhist_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);