X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmain.c;h=2e0f46fb548267aff7e04aa577f2156d79bb7889;hb=17f95a3fd30247a0735a3526d85b46178304748d;hp=8a40fe52a7ddf9fff083e68ddcb6f874490921b5;hpb=554311a4c88a847f9f65055af72b5a761b5b8a49;p=openldap diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 8a40fe52a7..2e0f46fb54 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -1,9 +1,10 @@ /* $OpenLDAP$ */ /* - * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ #include "portable.h" +#include "slapi_common.h" #include @@ -16,7 +17,9 @@ #include "ldap_pvt.h" + #include "slap.h" +#include "slapi.h" #include "lutil.h" #include "ldif.h" @@ -81,7 +84,7 @@ static STRDISP syslog_types[] = { { "LOCAL5", sizeof("LOCAL5"), LOG_LOCAL5 }, { "LOCAL6", sizeof("LOCAL6"), LOG_LOCAL6 }, { "LOCAL7", sizeof("LOCAL7"), LOG_LOCAL7 }, - { NULL } + { NULL, 0, 0 } }; static int cnvt_str2int( char *, STRDISP_P, int ); @@ -405,6 +408,20 @@ int main( int argc, char **argv ) (void) ldap_pvt_tls_set_option( NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &rc ); #endif +#ifdef LDAP_SLAPI + if ( slapi_init() != 0 ) { +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, CRIT, "main: slapi initialization error\n", 0, 0, 0 ); +#else + Debug( LDAP_DEBUG_ANY, + "slapi initialization error\n", + 0, 0, 0 ); +#endif + + goto destroy; + } +#endif /* LDAP_SLAPI */ + if ( read_config( configfile, 0 ) != 0 ) { rc = 1; SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 19 ); @@ -467,7 +484,7 @@ int main( int argc, char **argv ) #else Debug( LDAP_DEBUG_ANY, "main: TLS init def ctx failed: %d\n", - 0, 0, 0 ); + rc, 0, 0 ); #endif rc = 1; SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 ); @@ -628,7 +645,7 @@ wait4child( int sig ) errno = save_errno; } -#endif /* SIGCHLD || SIGCLD */ +#endif /* LDAP_SIGCHLD */ #ifdef LOG_LOCAL4