]> git.sur5r.net Git - openldap/commitdiff
During cleanup always unlock root_mutex if rootlock is true
authorKurt Zeilenga <kurt@openldap.org>
Thu, 21 Jan 1999 22:20:03 +0000 (22:20 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 21 Jan 1999 22:20:03 +0000 (22:20 +0000)
(don't make it conditional on p == NULL)

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 26dfd66154166f9b2184f7b965a9f242805a5111..fbf31f43b46f890dcacd212ae13c06cdb4c653f1 100644 (file)
@@ -119,8 +119,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;
        }
 
        /*
@@ -134,7 +134,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);
                }
@@ -208,8 +209,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 699e57ca96c14e285d10ef69b9355e319cc10c11..79f405a7b5422e0075fef66bf9f85cc9fee732ec 100644 (file)
@@ -141,8 +141,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 7caeacb9df32092b0fb96251c39bc1b2fd07daeb..7fac3f8c8b69f5c915cd1abd235391bb6a9a6b11 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_modlist( be, conn, op, e, modlist )) != LDAP_SUCCESS ) {
                send_ldap_result( conn, op, err, NULL, NULL );
                goto error_return;
index 83c67468c46465fab99eb7e5b65d5db30640983b..33f6536bdc7b01be884e021d8e92fcfb396d56ee 100644 (file)
@@ -176,8 +176,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);
        }