diff options
author | Volker Lendecke <vl@samba.org> | 2019-08-13 16:04:13 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-17 22:49:36 +0000 |
commit | be799acb4558f347c6e6a82874897c7af0c0c3d8 (patch) | |
tree | bf5c7be5f619b070e720f9cf2b350762ecb8cbdb /source3/locking | |
parent | 55e47ada9f85d5152b342d7d39226dc18bbaf162 (diff) | |
download | samba-be799acb4558f347c6e6a82874897c7af0c0c3d8.tar.gz |
smbd: Use share_entry_stale_pid() in share_mode_stale_pid()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 0cb6c6ff2f3..547741ecbc7 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -744,8 +744,8 @@ bool share_entry_stale_pid(struct share_mode_entry *e) */ bool share_mode_stale_pid(struct share_mode_data *d, uint32_t idx) { - struct server_id_buf tmp; struct share_mode_entry *e; + bool stale; if (idx > d->num_share_modes) { DBG_WARNING("Asking for index %"PRIu32", " @@ -755,27 +755,12 @@ bool share_mode_stale_pid(struct share_mode_data *d, uint32_t idx) return false; } e = &d->share_modes[idx]; - if (e->stale) { - /* - * Checked before - */ - return true; - } - if (serverid_exists(&e->pid)) { - DBG_DEBUG("PID %s (index %"PRIu32" out of %"PRIu32") " - "still exists\n", - server_id_str_buf(e->pid, &tmp), - idx, - d->num_share_modes); + + stale = share_entry_stale_pid(e); + if (!stale) { return false; } - DBG_DEBUG("PID %s (index %"PRIu32" out of %"PRIu32") " - "does not exist anymore\n", - server_id_str_buf(e->pid, &tmp), - idx, - d->num_share_modes); - - e->stale = true; + d->modified = true; if (d->num_delete_tokens != 0) { uint32_t i; |