#include <stdio.h>
#include <sys/types.h>
+#ifdef CLDAP
#include <sys/socket.h>
+#endif
#include "slap.h"
#include "ldapconfig.h"
#include "back-ldbm.h"
IDList *idl
)
{
- int rc;
+ int rc, flags;
Datum data;
+ struct ldbminfo *li = (struct ldbminfo *) be->be_private;
/* Debug( LDAP_DEBUG_TRACE, "=> idl_store\n", 0, 0, 0 ); */
data.dptr = (char *) idl;
data.dsize = (2 + idl->b_nmax) * sizeof(ID);
-
- rc = ldbm_cache_store( db, key, data, LDBM_REPLACE );
+
+ flags = LDBM_REPLACE;
+ if( li->li_flush_wrt ) flags |= LDBM_SYNC;
+ rc = ldbm_cache_store( db, key, data, flags );
/* Debug( LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */
return( rc );
if ( a == NULL ) {
return( NULL );
}
- if ( b == NULL ) {
+ if ( b == NULL || ALLIDS( b )) {
return( idl_dup( a ) );
}
- if ( ALLIDS( b ) ) {
- return( NULL );
- }
if ( ALLIDS( a ) ) {
n = idl_alloc( SLAPD_LDBM_MIN_MAXIDS );