]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:g_lock: remove redundant code in g_lock_trylock()
authorStefan Metzmacher <metze@samba.org>
Sun, 28 Aug 2022 09:58:14 +0000 (11:58 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
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 <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/g_lock.c

index ec10e5b85148830695f9c5d9dad1b19ccff492e0..96dac8c99edc66283385e08639e156a3ca41114c 100644 (file)
@@ -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);