]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/add.c
Removed unnecessary definition that is already in core.schema.
[openldap] / servers / slapd / back-ldbm / add.c
index b99ade9cf510382d53819bc507865fbf569355f2..dbb96e8f22dc89bafea411a2c5ce5986c42bfe1d 100644 (file)
@@ -126,7 +126,7 @@ ldbm_back_add(
        /*
         * Try to add the entry to the cache, assign it a new dnid.
         */
-       rc = cache_add_entry_rw(&li->li_cache, e, ENTRY_STATE_CREATING, 1);
+       rc = cache_add_entry_rw(&li->li_cache, e, CACHE_WRITE_LOCK);
 
        if ( rc != 0 ) {
                if( p != NULL) {
@@ -218,10 +218,10 @@ return_results:;
                ldap_pvt_thread_mutex_unlock(&li->li_root_mutex);
        }
 
-       cache_set_state( &li->li_cache, e, 0 );
-
-       /* free entry and writer lock */
-       cache_return_entry_w( &li->li_cache, e ); 
+       if ( rc ) {
+               /* free entry and writer lock */
+               cache_return_entry_w( &li->li_cache, e );
+       }
 
        return( rc );
 }