1 /* close.c - close ldbm backend */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2004 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
21 #include <ac/socket.h>
24 #include "back-ldbm.h"
27 ldbm_back_db_close( Backend *be )
29 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
30 if ( li->li_dbsyncfreq > 0 )
33 ldap_pvt_thread_join( li->li_dbsynctid, (void *) NULL );
36 LDAP_LOG( BACK_LDBM, CRIT,
37 "ldbm_back_db_close: ldbm backend syncing\n", 0, 0, 0 );
39 Debug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 );
42 ldbm_cache_flush_all( be );
44 LDAP_LOG( BACK_LDBM, CRIT,
45 "ldbm_back_db_close: ldbm backend synch'ed\n", 0, 0, 0 );
47 Debug( LDAP_DEBUG_TRACE, "ldbm backend done syncing\n", 0, 0, 0 );
51 cache_release_all( &((struct ldbminfo *) be->be_private)->li_cache );