}
int
-alock_close ( alock_info_t * info )
+alock_close ( alock_info_t * info, int nosave )
{
alock_slot_t slot_data;
int res;
free (slot_data.al_appname);
return ALOCK_UNSTABLE;
}
- slot_data.al_lock = ALOCK_UNLOCKED | (slot_data.al_lock & ALOCK_NOSAVE);
+ slot_data.al_lock = ALOCK_UNLOCKED;
+ if ( nosave )
+ slot_data.al_lock |= ALOCK_NOSAVE;
res = alock_write_slot (info, &slot_data);
if (res == -1) {
close (info->al_fd);
LDAP_SLAPD_F (int) alock_open LDAP_P(( alock_info_t * info, const char * appname,
const char * envdir, int locktype ));
LDAP_SLAPD_F (int) alock_scan LDAP_P(( alock_info_t * info ));
-LDAP_SLAPD_F (int) alock_close LDAP_P(( alock_info_t * info ));
+LDAP_SLAPD_F (int) alock_close LDAP_P(( alock_info_t * info, int nosave ));
LDAP_SLAPD_F (int) alock_recover LDAP_P(( alock_info_t * info ));
LDAP_END_DECL
be->be_suffix[0].bv_val, 0, 0 );
if ( quick ) {
Debug( LDAP_DEBUG_ANY,
- "Cannot use Quick mode, perform manual recovery first.\n",
+ "Cannot use Quick mode; perform manual recovery first.\n",
0, 0, 0 );
- return -1;
+ slapMode ^= SLAP_TOOL_QUICK;
+ rc = -1;
+ goto fail;
} else {
Debug( LDAP_DEBUG_ANY,
"Performing database recovery to activate new settings.\n",
}
}
- rc = alock_close( &bdb->bi_alock_info );
+ rc = alock_close( &bdb->bi_alock_info, slapMode & SLAP_TOOL_QUICK );
if( rc != 0 ) {
Debug( LDAP_DEBUG_ANY,
"bdb_db_close: database \"%s\": alock_close failed\n",