- if (locked) {
- if (tdb1_nest_unlock(tdb, TDB1_ACTIVE_LOCK, F_WRLCK, false) == -1) {
- TDB1_LOG((tdb, TDB1_DEBUG_ERROR, "tdb1_open_ex: "
- "failed to release ACTIVE_LOCK on %s: %s\n",
- name, strerror(errno)));
- goto fail;
- }
-
- }
-
- /* We always need to do this if the CLEAR_IF_FIRST flag is set, even if
- we didn't get the initial exclusive lock as we need to let all other
- users know we're using it. */
-
- if (tdb1_flags & TDB1_CLEAR_IF_FIRST) {
- /* leave this lock in place to indicate it's in use */
- if (tdb1_nest_lock(tdb, TDB1_ACTIVE_LOCK, F_RDLCK, TDB1_LOCK_WAIT) == -1) {
- goto fail;
- }
- }