If a problem directory is locked by a process and the process tries to lock directory again the function dd_lock() fals to infinite loop. In this case the function get_and_set_lock() correctly recognizes that a lock is owned by the process but the function returns an error value 0. The correct returned value is 1 because a directory is locked by the process thus lock was successful.
Signed-off-by: Jakub Filak <[email protected]> --- src/lib/dump_dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/dump_dir.c b/src/lib/dump_dir.c index a61fccf..5b759c6 100644 --- a/src/lib/dump_dir.c +++ b/src/lib/dump_dir.c @@ -147,7 +147,7 @@ static int get_and_set_lock(const char* lock_file, const char* pid) if (strcmp(pid_buf, pid) == 0) { log("Lock file '%s' is already locked by us", lock_file); - return 0; + return 1; } if (isdigit_str(pid_buf)) { -- 1.7.10.2
