common: Support not-removing the lockfile by dotlock_destroy.

* common/dotlock.c (dotlock_destroy): Keep the lock
when DOTLOCK_LOCK_BY_PARENT.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-12-20 10:38:08 +09:00
parent 5488ad0517
commit 2f6fec3f48
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
1 changed files with 4 additions and 1 deletions

View File

@ -1200,8 +1200,11 @@ dotlock_destroy (dotlock_t h)
UNLOCK_all_lockfiles ();
/* Then destroy the lock. */
if (!h->disable)
if (!h->disable
&& (!h->by_parent || h->no_write))
{
/* NOTE: under the condition of (by_parent && !no_write),
it doesn't come here. So, the lock file remains. */
#ifdef HAVE_DOSISH_SYSTEM
dotlock_destroy_w32 (h);
#else /* !HAVE_DOSISH_SYSTEM */