mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Centralize slap init/startup/shutdown/destroy into slapcommon
This commit is contained in:
parent
79a3553039
commit
a1987f662d
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -211,4 +211,12 @@ slap_tool_init(
|
||||
} else {
|
||||
be = &backends[dbnum];
|
||||
}
|
||||
|
||||
slap_startup( be );
|
||||
}
|
||||
|
||||
void slap_tool_destroy( void )
|
||||
{
|
||||
slap_shutdown( be );
|
||||
slap_destroy();
|
||||
}
|
||||
|
@ -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_ */
|
||||
|
@ -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 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user