diff options
| author | NIIBE Yutaka <[email protected]> | 2025-11-25 01:17:35 +0000 |
|---|---|---|
| committer | NIIBE Yutaka <[email protected]> | 2025-11-25 01:17:35 +0000 |
| commit | 32a3e5f83bbb8c6f21fcc11d28330e136fbe1785 (patch) | |
| tree | 6b0ac31dd4a328ae7e26eac87413093322de1695 | |
| parent | kbx:sqlite: Don't call dotlock_release. (diff) | |
| download | gnupg-32a3e5f83bbb8c6f21fcc11d28330e136fbe1785.tar.gz gnupg-32a3e5f83bbb8c6f21fcc11d28330e136fbe1785.zip | |
* common/dotlock.c (dotlock_take): Use my_info_1 when already locked.
(dotlock_release): Likewise.
--
Since recursive lock is not intended with dotlock (yet), it's a
programming error when detecting already locked state on the call of
dotlock_take. Also, it's a programming error when detecting
non-locked state on the call of dotlock_release. Use of my_debug_1 is
not relevant here.
Signed-off-by: NIIBE Yutaka <[email protected]>
| -rw-r--r-- | common/dotlock.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/common/dotlock.c b/common/dotlock.c index c3a4af855..b96854afb 100644 --- a/common/dotlock.c +++ b/common/dotlock.c @@ -1548,7 +1548,7 @@ dotlock_take (dotlock_t h, long timeout) if ( h->locked ) { - my_debug_1 ("Oops, '%s' is already locked\n", h->lockname); + my_info_1 ("Oops, '%s' is already locked\n", h->lockname); return 0; } @@ -1659,10 +1659,13 @@ dotlock_release (dotlock_t h) if ( !h->locked ) { - my_debug_1 ("Oops, '%s' is not locked\n", h->lockname); - if (h->info_cb) - h->info_cb (h, h->info_cb_value, DOTLOCK_NOT_LOCKED, - "Oops, '%s' is not locked\n", h->lockname); + if (!never_lock) + { + my_info_1 ("Oops, '%s' is not locked\n", h->lockname); + if (h->info_cb) + h->info_cb (h, h->info_cb_value, DOTLOCK_NOT_LOCKED, + "Oops, '%s' is not locked\n", h->lockname); + } return 0; } |
