]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Debug level can now be set using multiple flags, values are bitwise OR'ed.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 18 Aug 1998 17:47:27 +0000 (17:47 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 18 Aug 1998 17:47:27 +0000 (17:47 +0000)
servers/slapd/main.c

index 01930b970910c9c1ad6cd9a8bf6939af58baed05..7f4ff2990bbfde5fb4e59b38b102ce1fd83898ca 100644 (file)
@@ -10,7 +10,7 @@
 #include "slap.h"
 #include "ldapconfig.h"
 
-extern void    daemon();
+extern void    slapd_daemon();
 extern int     lber_debug;
 
 extern char Versionstr[];
@@ -19,7 +19,7 @@ extern char Versionstr[];
  * read-only global variables or variables only written by the listener
  * thread (after they are initialized) - no need to protect them with a mutex.
  */
-int            ldap_debug;
+int            ldap_debug = 0;
 #ifdef LDAP_DEBUG
 int            ldap_syslog = LDAP_DEBUG_STATS;
 #else
@@ -63,7 +63,7 @@ static
 usage( name )
     char       *name;
 {
-       fprintf( stderr, "usage: %s [-d debuglevel] [-f configfile] [-p portnumber] [-s sysloglevel]\n", name );
+       fprintf( stderr, "usage: %s [-d ?|debuglevel] [-f configfile] [-p portnumber] [-s sysloglevel]\n", name );
 }
 
 main( argc, argv )
@@ -105,19 +105,19 @@ main( argc, argv )
                                    LDAP_DEBUG_CONFIG );
                                printf( "\tLDAP_DEBUG_ACL\t\t%d\n",
                                    LDAP_DEBUG_ACL );
-                               printf( "\tLDAP_DEBUG_STATS\t\t%d\n",
+                               printf( "\tLDAP_DEBUG_STATS\t%d\n",
                                    LDAP_DEBUG_STATS );
-                               printf( "\tLDAP_DEBUG_STATS2\t\t%d\n",
+                               printf( "\tLDAP_DEBUG_STATS2\t%d\n",
                                    LDAP_DEBUG_STATS2 );
-                               printf( "\tLDAP_DEBUG_SHELL\t\t%d\n",
+                               printf( "\tLDAP_DEBUG_SHELL\t%d\n",
                                    LDAP_DEBUG_SHELL );
-                               printf( "\tLDAP_DEBUG_PARSE\t\t%d\n",
+                               printf( "\tLDAP_DEBUG_PARSE\t%d\n",
                                    LDAP_DEBUG_PARSE );
                                printf( "\tLDAP_DEBUG_ANY\t\t%d\n",
                                    LDAP_DEBUG_ANY );
                                exit( 0 );
                        } else {
-                               ldap_debug = atoi( optarg );
+                               ldap_debug |= atoi( optarg );
                                lber_debug = (ldap_debug & LDAP_DEBUG_BER);
                        }
                        break;
@@ -184,7 +184,7 @@ main( argc, argv )
                pthread_attr_init( &attr );
                pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
 
-               if ( pthread_create( &listener_tid, attr, (void *) daemon,
+               if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon,
                    (void *) port ) != 0 ) {
                        Debug( LDAP_DEBUG_ANY,
                            "listener pthread_create failed\n", 0, 0, 0 );