]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
g_lock: Move a variable inside the block were it's used
authorVolker Lendecke <vl@samba.org>
Fri, 22 Nov 2019 10:56:55 +0000 (11:56 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 26 Nov 2019 21:28:30 +0000 (21:28 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/g_lock.c

index ae7a478d148c72f0153af1083afe997cc60dcc61..208c7efc53120fbab4ae3fd77beb624a73445aab 100644 (file)
@@ -325,7 +325,6 @@ static NTSTATUS g_lock_trylock(
        struct g_lock lck = { .exclusive.pid = 0 };
        struct server_id_buf tmp;
        NTSTATUS status;
-       bool exists;
        bool ok;
 
        ok = g_lock_parse(data.dptr, data.dsize, &lck);
@@ -345,7 +344,7 @@ static NTSTATUS g_lock_trylock(
                bool self_exclusive = server_id_equal(&self, &lck.exclusive);
 
                if (!self_exclusive) {
-                       exists = serverid_exists(&lck.exclusive);
+                       bool exists = serverid_exists(&lck.exclusive);
                        if (!exists) {
                                lck.exclusive = (struct server_id) { .pid=0 };
                                goto noexclusive;