From 7cac6eb5d810f78e52292964808f7e163ced105c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 28 Aug 2022 11:58:14 +0200 Subject: [PATCH] s3:g_lock: remove redundant code in g_lock_trylock() g_lock_cleanup_shared() handles lck.num_shared == 0 just fine... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/lib/g_lock.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index ec10e5b8514..96dac8c99ed 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -861,16 +861,6 @@ do_shared: */ dbwrap_watched_watch_remove_instance(rec, state->watch_instance); - if (lck.num_shared == 0) { - status = g_lock_store(rec, &lck, &self, NULL, 0); - if (!NT_STATUS_IS_OK(status)) { - DBG_DEBUG("g_lock_store() failed: %s\n", - nt_errstr(status)); - } - - return status; - } - g_lock_cleanup_shared(&lck); status = g_lock_store(rec, &lck, &self, NULL, 0);