Don't remove lock, if other LCR is using it

This commit is contained in:
Andreas Eversberg 2012-07-28 16:04:58 +02:00
parent a698197188
commit 623ef90b50
1 changed files with 4 additions and 2 deletions

6
main.c
View File

@ -581,8 +581,10 @@ free:
if (created_lock)
flock(lockfd, LOCK_UN);
if (lockfd >= 0) {
chmod(lock, 0700);
unlink(lock);
if (created_lock) {
chmod(lock, 0700);
unlink(lock);
}
close(lockfd);
}