]> git.sur5r.net Git - openldap/commitdiff
Clean up a few globals
authorKurt Zeilenga <kurt@openldap.org>
Thu, 27 Dec 2001 02:03:57 +0000 (02:03 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 27 Dec 2001 02:03:57 +0000 (02:03 +0000)
servers/slapd/init.c
servers/slapd/main.c
servers/slapd/proto-slap.h
servers/slapd/tools/slapadd.c
servers/slapd/tools/slapcommon.c
servers/slapd/tools/slapcommon.h

index eabb73b13b0394f33f547d22a3ba568aea6034c3..e6a4187d5f4dea2d1bd5575fec39d09445eebcb0 100644 (file)
@@ -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
index c46d0b2b6de9b7658ede71fadd24f15caa63057b..894380a80447718974eae0eac217fede7a93ae92 100644 (file)
@@ -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
        {
index 9343b36ea6a4359808b1ea872fecdc31b508a7f8..b9e8adefa115ece862f77a72f16bcfebb7c1e290 100644 (file)
@@ -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 */
index dd25c6cd2c71b0ae460a988c010f2caca4e1a668..c1c0d4585dea89dfe6271503fb71fd4a7161d121 100644 (file)
@@ -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,
index e2f90b88f46a6ac9f329c465e72048bf9a23532a..98c436f5ddeb08e3b2309da8260f6033701f50ca 100644 (file)
@@ -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++;
                }
 
index 600418b0c4eb5ff0ab82f81439e8a1e6b9f139c2..9214c2074f007267f0a1658662bd51b5602980d1 100644 (file)
@@ -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;