1/* 2 * $Id: cnid_cdb_close.c,v 1.2 2005-04-28 20:49:59 bfernhomberg Exp $ 3 */ 4 5#ifdef HAVE_CONFIG_H 6#include "config.h" 7#endif /* HAVE_CONFIG_H */ 8 9#ifdef CNID_BACKEND_CDB 10#include "cnid_cdb_private.h" 11 12void cnid_cdb_close(struct _cnid_db *cdb) { 13 CNID_private *db; 14 15 if (!cdb) { 16 LOG(log_error, logtype_afpd, "cnid_close called with NULL argument !"); 17 return; 18 } 19 20 if (!(db = cdb->_private)) { 21 return; 22 } 23 db->db_didname->sync(db->db_didname, 0); 24 db->db_devino->sync(db->db_devino, 0); 25 db->db_cnid->sync(db->db_cnid, 0); 26 27 db->db_didname->close(db->db_didname, 0); 28 db->db_devino->close(db->db_devino, 0); 29 db->db_cnid->close(db->db_cnid, 0); 30 31 db->dbenv->close(db->dbenv, 0); 32 33 free(db); 34 free(cdb->volpath); 35 free(cdb); 36} 37 38#endif /* CNID_BACKEND_CDB */ 39