]> git.sur5r.net Git - openldap/commitdiff
ITS#3937 add config_syslog var to track state of loglevel directive,
authorHoward Chu <hyc@openldap.org>
Sun, 28 Aug 2005 07:11:10 +0000 (07:11 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 28 Aug 2005 07:11:10 +0000 (07:11 +0000)
copy to ldap_syslog when in SLAP_SERVER_MODE

servers/slapd/bconfig.c

index c25ac669fea558aa4272c97e36937ed65d1be36c..6b75c27b918a5dec33d15f91e08d23073e05b6ad 100644 (file)
@@ -1965,6 +1965,8 @@ str2loglevel( const char *s, int *l )
        return 0;
 }
 
+static int config_syslog;
+
 static int
 config_loglevel(ConfigArgs *c) {
        int i;
@@ -1975,18 +1977,21 @@ config_loglevel(ConfigArgs *c) {
        }
 
        if (c->op == SLAP_CONFIG_EMIT) {
-               return mask_to_verbs( loglevel_ops, ldap_syslog, &c->rvalue_vals );
+               return mask_to_verbs( loglevel_ops, config_syslog, &c->rvalue_vals );
        } else if ( c->op == LDAP_MOD_DELETE ) {
                if ( !c->line ) {
-                       ldap_syslog = 0;
+                       config_syslog = 0;
                } else {
                        int level = verb_to_mask( c->line, loglevel_ops );
-                       ldap_syslog ^= level;
+                       config_syslog ^= level;
+               }
+               if ( slapMode & SLAP_SERVER_MODE ) {
+                       ldap_syslog = config_syslog;
                }
                return 0;
        }
 
-       ldap_syslog = 0;
+       config_syslog = 0;
 
        for( i=1; i < c->argc; i++ ) {
                int     level;
@@ -2007,7 +2012,10 @@ config_loglevel(ConfigArgs *c) {
                                return( 1 );
                        }
                }
-               ldap_syslog |= level;
+               config_syslog |= level;
+               if ( slapMode & SLAP_SERVER_MODE ) {
+                       ldap_syslog = config_syslog;
+               }
        }
        return(0);
 }