]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Import rootlock change from rel eng 1.2
authorKurt Zeilenga <kurt@openldap.org>
Fri, 22 Jan 1999 21:35:39 +0000 (21:35 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 22 Jan 1999 21:35:39 +0000 (21:35 +0000)
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c

index 849289ca12c3e48ee00f7b0283bd6e4162e47e14..6faaf948f30cbfcb741b81e47e1336edb919c060 100644 (file)
@@ -124,8 +124,8 @@ ldbm_back_add(
                 * and release the add lock.
                 */
                pthread_mutex_lock(&li->li_root_mutex);
+               rootlock = 1;
                pthread_mutex_unlock(&li->li_add_mutex);
-               rootlock=1;
        }
 
        /*
@@ -139,7 +139,8 @@ ldbm_back_add(
                if( p != NULL) {
                        /* free parent and writer lock */
                        cache_return_entry_w( &li->li_cache, p ); 
-               } else if ( rootlock ) {
+               }
+               if ( rootlock ) {
                        /* release root lock */
                        pthread_mutex_unlock(&li->li_root_mutex);
                }
@@ -217,8 +218,9 @@ return_results:;
        if (p != NULL) {
                /* free parent and writer lock */
                cache_return_entry_w( &li->li_cache, p ); 
+       }
 
-       } else if ( rootlock ) {
+       if ( rootlock ) {
                /* release root lock */
                pthread_mutex_unlock(&li->li_root_mutex);
        }
index 8511c140808e25a0c4230a3e254b69380c71d8c9..144d1a16b28e25de2bce24f6cb183000f9604376 100644 (file)
@@ -140,8 +140,9 @@ return_results:;
        if( p != NULL ) {
                /* free parent and writer lock */
                cache_return_entry_w( &li->li_cache, p );
+       }
 
-       } else if ( rootlock ) {
+       if ( rootlock ) {
                /* release root lock */
                pthread_mutex_unlock(&li->li_root_mutex);
        }
index 2f74c108f1aa65a5c8173dcb44344d3154e385e9..652795bd7b19dbf788d363448a762d246d5a2db6 100644 (file)
@@ -32,6 +32,7 @@ ldbm_back_modify(
 
        Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
 
+       /* acquire and lock entry */
        if ( (e = dn2entry_w( be, dn, &matched )) == NULL ) {
                send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched,
                    NULL );
@@ -41,10 +42,6 @@ ldbm_back_modify(
                return( -1 );
        }
 
-       /* check for deleted */
-
-       /* lock entry */
-
        if ( (err = acl_check_mods( be, conn, op, e, mods )) != LDAP_SUCCESS ) {
                send_ldap_result( conn, op, err, NULL, NULL );
                goto error_return;
index ea8b2c4fba2084c403c180ddedd7d03dd4874c58..c98abc779399e96b3afdfa137706dec098829bfe 100644 (file)
@@ -168,8 +168,9 @@ return_results:
        if( p != NULL ) {
                /* free parent and writer lock */
                cache_return_entry_w( &li->li_cache, p );
+       }
 
-       } else if ( rootlock ) {
+       if ( rootlock ) {
                /* release root writer lock */
                pthread_mutex_unlock(&li->li_root_mutex);
        }