int rc = EXIT_SUCCESS;
slap_tool_init( "slapadd", SLAPADD, argc, argv );
- slap_startup( be );
if( !be->be_entry_open &&
!be->be_entry_close &&
be->be_sync( be );
}
- slap_shutdown( be );
- slap_destroy();
-
+ slap_tool_destroy();
return rc;
}
slap_tool_init( "slapcat", SLAPCAT, argc, argv );
- slap_startup( be );
-
if( !be->be_entry_open &&
!be->be_entry_close &&
!be->be_entry_first &&
be->be_entry_close( be );
- slap_shutdown( be );
- slap_destroy();
-
+ slap_tool_destroy();
return rc;
}
} else {
be = &backends[dbnum];
}
+
+ slap_startup( be );
+}
+
+void slap_tool_destroy( void )
+{
+ slap_shutdown( be );
+ slap_destroy();
}
int tool,
int argc, char **argv ));
+void slap_tool_destroy LDAP_P((void));
+
#endif /* SLAPCOMMON_H_ */
slap_tool_init( "slapindex", SLAPINDEX, argc, argv );
- slap_startup( be );
-
if( !be->be_entry_open &&
!be->be_entry_close &&
!be->be_entry_first &&
(void) be->be_entry_close( be );
- slap_shutdown( be );
- slap_destroy();
+ slap_tool_destroy();
return( rc );
}