# HG changeset patch # User Timo Sirainen # Date 1102380098 -7200 # Node ID 0e7a0e204f5d2d7b99788c1ed4ace7464ef68ca4 # Parent a519f183bacfb429fa2faf4f3ad9173a6ecf5a0b If pid in dotlock file is same as ours, assume a stale lock file. diff -r a519f183bacf -r 0e7a0e204f5d src/lib/file-dotlock.c --- a/src/lib/file-dotlock.c Tue Dec 07 02:26:01 2004 +0200 +++ b/src/lib/file-dotlock.c Tue Dec 07 02:41:38 2004 +0200 @@ -131,8 +131,13 @@ if (lock_info->have_pid) { /* we've local PID. Check if it exists. */ - if (kill(pid, 0) == 0 || errno != ESRCH) - return 0; + if (kill(pid, 0) == 0 || errno != ESRCH) { + if (pid != getpid()) + return 0; + /* it's us. either we're locking it again, or it's a + stale lock file with same pid than us. either way, + recreate it.. */ + } /* doesn't exist - go ahead and delete */ if (unlink(lock_info->lock_path) < 0 && errno != ENOENT) {