Centralize slap init/startup/shutdown/destroy into slapcommon

This commit is contained in:
Kurt Zeilenga 1999-08-19 17:20:15 +00:00
parent 79a3553039
commit a1987f662d
5 changed files with 13 additions and 13 deletions

View File

@ -24,7 +24,6 @@ main( int argc, char **argv )
int rc = EXIT_SUCCESS;
slap_tool_init( "slapadd", SLAPADD, argc, argv );
slap_startup( be );
if( !be->be_entry_open &&
!be->be_entry_close &&
@ -112,8 +111,6 @@ main( int argc, char **argv )
be->be_sync( be );
}
slap_shutdown( be );
slap_destroy();
slap_tool_destroy();
return rc;
}

View File

@ -21,8 +21,6 @@ main( int argc, char **argv )
slap_tool_init( "slapcat", SLAPCAT, argc, argv );
slap_startup( be );
if( !be->be_entry_open &&
!be->be_entry_close &&
!be->be_entry_first &&
@ -75,8 +73,6 @@ main( int argc, char **argv )
be->be_entry_close( be );
slap_shutdown( be );
slap_destroy();
slap_tool_destroy();
return rc;
}

View File

@ -211,4 +211,12 @@ slap_tool_init(
} else {
be = &backends[dbnum];
}
slap_startup( be );
}
void slap_tool_destroy( void )
{
slap_shutdown( be );
slap_destroy();
}

View File

@ -35,4 +35,6 @@ void slap_tool_init LDAP_P((
int tool,
int argc, char **argv ));
void slap_tool_destroy LDAP_P((void));
#endif /* SLAPCOMMON_H_ */

View File

@ -24,8 +24,6 @@ main( int argc, char **argv )
slap_tool_init( "slapindex", SLAPINDEX, argc, argv );
slap_startup( be );
if( !be->be_entry_open &&
!be->be_entry_close &&
!be->be_entry_first &&
@ -111,8 +109,7 @@ main( int argc, char **argv )
(void) be->be_entry_close( be );
slap_shutdown( be );
slap_destroy();
slap_tool_destroy();
return( rc );
}