1 /* close.c - close ldbm backend */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/socket.h>
15 #include "back-ldbm.h"
18 ldbm_back_db_close( Backend *be )
20 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
21 if ( li->li_dbsyncfreq > 0 )
24 ldap_pvt_thread_join( li->li_dbsynctid, (void *) NULL );
27 LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
28 "ldbm_back_db_close: ldbm backend syncing\n" ));
30 Debug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 );
33 ldbm_cache_flush_all( be );
35 LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
36 "ldbm_back_db_close: ldbm backend synch'ed\n" ));
38 Debug( LDAP_DEBUG_TRACE, "ldbm backend done syncing\n", 0, 0, 0 );
42 cache_release_all( &((struct ldbminfo *) be->be_private)->li_cache );