smbd: Avoid calling serverid_exists twice
authorVolker Lendecke <vl@samba.org>
Mon, 23 Sep 2013 02:16:56 +0000 (19:16 -0700)
committerStefan Metzmacher <metze@samba.org>
Sun, 6 Oct 2013 11:54:14 +0000 (13:54 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/locking/locking.c

index d4c68f8841babf645a50d7dba3ae3a6157a84140..d0b6eaf995c3bc96f74f8aa90524927a747d96b4 100644 (file)
@@ -646,6 +646,12 @@ bool share_mode_stale_pid(struct share_mode_data *d, unsigned idx)
                return false;
        }
        e = &d->share_modes[idx];
+       if (e->stale) {
+               /*
+                * Checked before
+                */
+               return true;
+       }
        if (serverid_exists(&e->pid)) {
                DEBUG(10, ("PID %s (index %u out of %u) still exists\n",
                           procid_str_static(&e->pid), idx,