From: Kurt Zeilenga Date: Thu, 27 Dec 2001 02:03:57 +0000 (+0000) Subject: Clean up a few globals X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~460 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f9c2dc3701e0ee0994b74de37fccfcd8191f43ea;p=openldap Clean up a few globals --- diff --git a/servers/slapd/init.c b/servers/slapd/init.c index eabb73b13b..e6a4187d5f 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -32,8 +32,6 @@ int ldap_syslog_level = LOG_DEBUG; #endif struct berval **default_referral = NULL; -int g_argc; -char **g_argv; /* * global variables that need mutex protection diff --git a/servers/slapd/main.c b/servers/slapd/main.c index c46d0b2b6d..894380a804 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -27,7 +27,7 @@ static RETSIGTYPE wait4child( int sig ); #ifdef HAVE_NT_SERVICE_MANAGER #define MAIN_RETURN(x) return -struct sockaddr_in bind_addr; +static struct sockaddr_in bind_addr; void CommenceStartupProcessing( LPCTSTR serverName, void(*stopper)(int)); @@ -135,6 +135,9 @@ int main( int argc, char **argv ) #ifdef LOG_LOCAL4 int syslogUser = DEFAULT_SYSLOG_USER; #endif + + int g_argc = argc; + char **g_argv = argv; #ifdef HAVE_NT_SERVICE_MANAGER char *configfile = ".\\slapd.conf"; @@ -151,8 +154,6 @@ int main( int argc, char **argv ) } #endif - g_argc = argc; - g_argv = argv; #ifdef HAVE_NT_SERVICE_MANAGER { diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 9343b36ea6..b9e8adefa1 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -953,7 +953,7 @@ LDAP_SLAPD_V (struct berval **) default_referral; LDAP_SLAPD_V (char *) replogfile; LDAP_SLAPD_V (const char) Versionstr[]; LDAP_SLAPD_V (struct slap_limits_set) deflimit; -LDAP_SLAPD_V (int) g_argc; + LDAP_SLAPD_V (slap_access_t) global_default_access; LDAP_SLAPD_V (int) global_lastmod; LDAP_SLAPD_V (int) global_idletimeout; @@ -982,7 +982,6 @@ LDAP_SLAPD_V (unsigned long) num_ops_initiated; LDAP_SLAPD_V (char *) slapd_pid_file; LDAP_SLAPD_V (char *) slapd_args_file; -LDAP_SLAPD_V (char **) g_argv; LDAP_SLAPD_V (time_t) starttime; /* use time(3) -- no mutex */ diff --git a/servers/slapd/tools/slapadd.c b/servers/slapd/tools/slapadd.c index dd25c6cd2c..c1c0d4585d 100644 --- a/servers/slapd/tools/slapadd.c +++ b/servers/slapd/tools/slapadd.c @@ -75,7 +75,9 @@ main( int argc, char **argv ) } /* check backend */ - if( select_backend( &e->e_nname, is_entry_referral(e), nosubs ) != be ) { + if( select_backend( &e->e_nname, is_entry_referral(e), nosubordinates ) + != be ) + { fprintf( stderr, "%s: line %d: " "database (%s) not configured to hold \"%s\"\n", progname, lineno, diff --git a/servers/slapd/tools/slapcommon.c b/servers/slapd/tools/slapcommon.c index e2f90b88f4..98c436f5dd 100644 --- a/servers/slapd/tools/slapcommon.c +++ b/servers/slapd/tools/slapcommon.c @@ -24,7 +24,7 @@ char *conffile = SLAPD_DEFAULT_CONFIGFILE; int truncatemode = 0; int verbose = 0; int continuemode = 0; -int nosubs = 0; +int nosubordinates = 0; char *ldiffile = NULL; FILE *ldiffp = NULL; @@ -233,7 +233,7 @@ slap_tool_init( * entire context */ if (be->be_glueflags & SLAP_GLUE_INSTANCE) - nosubs = 1; + nosubordinates = 1; } else if ( dbnum == -1 ) { be = &backends[dbnum=0]; @@ -241,7 +241,7 @@ slap_tool_init( * glue subordinate, find the master. */ while (be->be_glueflags & SLAP_GLUE_SUBORDINATE) { - nosubs = 1; + nosubordinates = 1; be++; } diff --git a/servers/slapd/tools/slapcommon.h b/servers/slapd/tools/slapcommon.h index 600418b0c4..9214c2074f 100644 --- a/servers/slapd/tools/slapcommon.h +++ b/servers/slapd/tools/slapcommon.h @@ -25,7 +25,7 @@ extern Backend *be; extern int appendmode; extern int verbose; extern int continuemode; -extern int nosubs; +extern int nosubordinates; extern char *ldiffile; extern FILE *ldiffp;