mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
ITS#9631 back-wt: closing cache db politely
This commit is contained in:
parent
f7d558a449
commit
c66c9f87eb
1 changed files with 15 additions and 10 deletions
|
|
@ -232,20 +232,25 @@ wt_db_close( BackendDB *be, ConfigReply *cr )
|
||||||
struct wt_info *wi = (struct wt_info *) be->be_private;
|
struct wt_info *wi = (struct wt_info *) be->be_private;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if ( !wi->wi_conn ) {
|
if ( wi->wi_cache ) {
|
||||||
return -1;
|
rc = wi->wi_cache->close(wi->wi_cache, NULL);
|
||||||
|
if( rc ) {
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"wt_db_close: cannot close cache database (%d).\n", rc );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = wi->wi_conn->close(wi->wi_conn, NULL);
|
if ( wi->wi_conn ) {
|
||||||
if( rc ) {
|
rc = wi->wi_conn->close(wi->wi_conn, NULL);
|
||||||
int saved_errno = errno;
|
if( rc ) {
|
||||||
Debug( LDAP_DEBUG_ANY,
|
Debug( LDAP_DEBUG_ANY,
|
||||||
"wt_db_close: cannot close database (%d).\n", saved_errno );
|
"wt_db_close: cannot close database (%d).\n", rc );
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
wi->wi_flags &= ~WT_IS_OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
wi->wi_flags &= ~WT_IS_OPEN;
|
|
||||||
|
|
||||||
return LDAP_SUCCESS;
|
return LDAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue