mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 23:59:34 -05:00
defer handling of loglevel listing, to let modules register custom subsystems (ITS#4666). Note: in case of any error in between, logging could not occur
This commit is contained in:
parent
4efbb9960c
commit
edd99f13f4
1 changed files with 15 additions and 6 deletions
|
|
@ -98,8 +98,9 @@ const char Versionstr[] =
|
||||||
OPENLDAP_PACKAGE " " OPENLDAP_VERSION " Standalone LDAP Server (slapd)";
|
OPENLDAP_PACKAGE " " OPENLDAP_VERSION " Standalone LDAP Server (slapd)";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CHECK_NONE 0x00
|
#define CHECK_NONE 0x00
|
||||||
#define CHECK_CONFIG 0x01
|
#define CHECK_CONFIG 0x01
|
||||||
|
#define CHECK_LOGLEVEL 0x02
|
||||||
static int check = CHECK_NONE;
|
static int check = CHECK_NONE;
|
||||||
static int version = 0;
|
static int version = 0;
|
||||||
|
|
||||||
|
|
@ -503,8 +504,8 @@ int main( int argc, char **argv )
|
||||||
int level = 0;
|
int level = 0;
|
||||||
|
|
||||||
if ( strcmp( optarg, "?" ) == 0 ) {
|
if ( strcmp( optarg, "?" ) == 0 ) {
|
||||||
rc = loglevel_print( stdout );
|
check |= CHECK_LOGLEVEL;
|
||||||
goto destroy;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
no_detach = 1;
|
no_detach = 1;
|
||||||
|
|
@ -564,8 +565,8 @@ int main( int argc, char **argv )
|
||||||
|
|
||||||
case 's': /* set syslog level */
|
case 's': /* set syslog level */
|
||||||
if ( strcmp( optarg, "?" ) == 0 ) {
|
if ( strcmp( optarg, "?" ) == 0 ) {
|
||||||
rc = loglevel_print( stdout );
|
check |= CHECK_LOGLEVEL;
|
||||||
goto destroy;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( parse_debug_level( optarg, &ldap_syslog, &syslog_unknowns ) ) {
|
if ( parse_debug_level( optarg, &ldap_syslog, &syslog_unknowns ) ) {
|
||||||
|
|
@ -765,6 +766,11 @@ unhandled_option:;
|
||||||
syslog_unknowns = NULL;
|
syslog_unknowns = NULL;
|
||||||
if ( rc )
|
if ( rc )
|
||||||
goto destroy;
|
goto destroy;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( check & CHECK_LOGLEVEL ) {
|
||||||
|
rc = 0;
|
||||||
|
goto destroy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( check & CHECK_CONFIG ) {
|
if ( check & CHECK_CONFIG ) {
|
||||||
|
|
@ -935,6 +941,9 @@ shutdown:
|
||||||
rc |= slap_shutdown( NULL );
|
rc |= slap_shutdown( NULL );
|
||||||
|
|
||||||
destroy:
|
destroy:
|
||||||
|
if ( check & CHECK_LOGLEVEL ) {
|
||||||
|
(void)loglevel_print( stdout );
|
||||||
|
}
|
||||||
/* remember an error during destroy */
|
/* remember an error during destroy */
|
||||||
rc |= slap_destroy();
|
rc |= slap_destroy();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue