]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
fix flush write typo
authorKurt Zeilenga <kurt@openldap.org>
Sun, 25 Oct 1998 16:51:39 +0000 (16:51 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 25 Oct 1998 16:51:39 +0000 (16:51 +0000)
servers/slapd/back-ldbm/id2entry.c

index fbda3c9952a9461766d2f4024e072054ca61530a..2c9156e498c430b18969c974260dec7e1d5c6d43 100644 (file)
@@ -20,7 +20,7 @@ id2entry_add( Backend *be, Entry *e )
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
        struct dbcache  *db;
        Datum           key, data;
-       int             len, rc;
+       int             len, rc, flags;
 
        Debug( LDAP_DEBUG_TRACE, "=> id2entry_add( %d, \"%s\" )\n", e->e_id,
            e->e_dn, 0 );
@@ -39,8 +39,10 @@ id2entry_add( Backend *be, Entry *e )
        data.dptr = entry2str( e, &len, 1 );
        data.dsize = len + 1;
 
-       /* store it - LDBM_SYNC ensures id2entry is always consistent */
-       rc = ldbm_cache_store( db, key, data, LDBM_REPLACE|LDBM_SYNC );
+       /* store it */
+       flags = LDBM_REPLACE;
+       if ( li->li_flush_wrt ) flags |= LDBM_SYNC;
+       rc = ldbm_cache_store( db, key, data, flags );
 
        pthread_mutex_unlock( &entry2str_mutex );