- if (locked) {
- if (tdb1_nest_unlock(tdb, TDB1_ACTIVE_LOCK, F_WRLCK) == -1) {
- tdb_logerr(tdb, tdb->last_error, TDB_LOG_ERROR,
- "tdb1_open_ex: "
- "failed to release ACTIVE_LOCK on %s: %s",
- 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;
- }
- }