g_lock: Move a variable inside the block were it's used
[amitay/samba.git] / 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;