bool modified = false;
struct share_mode_entry e;
uint8_t *e_ptr = NULL;
- bool had_share_entries, have_share_entries;
NTSTATUS status;
bool ret = false;
}
DBG_DEBUG("num_share_modes=%zu\n", ltdb->num_share_entries);
- had_share_entries = (ltdb->num_share_entries != 0);
-
idx = share_mode_entry_find(
ltdb->share_entries,
ltdb->num_share_entries,
}
ltdb->num_share_entries -= 1;
+ if (ltdb->num_share_entries == 0) {
+ /*
+ * Tell share_mode_lock_destructor() to delete
+ * the whole record
+ */
+ d->modified = true;
+ }
+
if (DEBUGLEVEL>=10) {
DBG_DEBUG("share_mode_entry:\n");
NDR_PRINT_DEBUG(share_mode_entry, &e);
goto done;
}
- have_share_entries = (ltdb->num_share_entries != 0);
- if (had_share_entries != have_share_entries) {
- /*
- * Make share_mode_data_store do the right thing wrt
- * possibly deleting the locking.tdb record
- */
- d->modified = true;
- }
-
ret = true;
done:
TALLOC_FREE(ltdb);