From 2f6fec3f482d3a6660ce9bf299c0ff7fae21b80b Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 20 Dec 2023 10:38:08 +0900 Subject: [PATCH] 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 --- common/dotlock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/dotlock.c b/common/dotlock.c index 06e3910ad..84d0b509c 100644 --- a/common/dotlock.c +++ b/common/dotlock.c @@ -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 */