From ae8a333bc8cae5af14a70a1f388ca64a0b6190cb Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 8 Aug 2005 12:51:38 +0000 Subject: [PATCH] ITS#3917 init schema before parsing args --- servers/slapd/main.c | 15 ++++++++------- servers/slapd/slapcommon.c | 7 ------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/servers/slapd/main.c b/servers/slapd/main.c index e0b870df4a..b607bdb912 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -271,6 +271,14 @@ int main( int argc, char **argv ) slap_sl_mem_init(); + if (( rc = slap_schema_init( )) != 0 ) { + Debug( LDAP_DEBUG_ANY, + "schema initialization error\n", + 0, 0, 0 ); + + MAIN_RETURN(rc); + } + serverName = lutil_progname( "slapd", argc, argv ); if ( strcmp( serverName, "slapd" ) ) { @@ -577,13 +585,6 @@ unhandled_option:; } #endif - if ( slap_schema_init( ) != 0 ) { - Debug( LDAP_DEBUG_ANY, - "schema initialization error\n", - 0, 0, 0 ); - - goto destroy; - } if ( slap_init( serverMode, serverName ) != 0 ) { rc = 1; diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index 0ef4b4e1f1..596cbc3182 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -400,13 +400,6 @@ slap_tool_init( } #endif - rc = slap_schema_init(); - - if ( rc != 0 ) { - fprintf( stderr, "%s: slap_schema_init failed!\n", progname ); - exit( EXIT_FAILURE ); - } - rc = slap_init( mode, progname ); if ( rc != 0 ) { -- 2.39.5