]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/globals.c
fix: changing bdb_cache_return_entry_w() to bdb_cache_return_entry_r()
[openldap] / servers / slurpd / globals.c
index 7e2c7081bf8b279b1066dd6d025d6c28578a3b20..3bafef51560a41159896e0ef3e264df991e886b4 100644 (file)
@@ -1,3 +1,8 @@
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  * Copyright (c) 1996 Regents of the University of Michigan.
  * All rights reserved.
@@ -18,6 +23,9 @@
 
 #include <stdio.h>
 
+#include <ac/stdlib.h>
+#include <ac/string.h>
+
 #include "slurp.h"
 #include "globals.h"
 
@@ -31,7 +39,8 @@ int ldap_debug = 0;
 /*
  * Initialize the globals
  */
-Globals *init_globals()
+Globals *
+init_globals( void )
 {
     Globals *g;
 
@@ -45,30 +54,27 @@ Globals *init_globals()
     g->slurpd_shutdown = 0;
     g->num_replicas = 0;
     g->replicas = NULL;
-    g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR;
+    g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR "/replica";
     strcpy( g->slurpd_status_file, DEFAULT_SLURPD_STATUS_FILE );
     g->slapd_replogfile[ 0 ] = '\0';
     g->slurpd_replogfile[ 0 ] = '\0';
     g->slurpd_status_file[ 0 ] = '\0';
     g->one_shot_mode = 0;
+    g->no_detach = 0;
     g->myname = NULL;
     g->srpos = 0L;
     if ( St_init( &(g->st)) < 0 ) {
        fprintf( stderr, "Cannot initialize status data\n" );
-       exit( 1 );
+       exit( EXIT_FAILURE );
     }
-    pthread_mutex_init( &(g->rej_mutex), pthread_mutexattr_default );
+    ldap_pvt_thread_mutex_init( &(g->rej_mutex) );
     if ( Rq_init( &(g->rq)) < 0 ) {
        fprintf( stderr, "Cannot initialize queue\n" );
-       exit( 1 );
+       exit( EXIT_FAILURE );
     }
-#ifdef HAVE_KERBEROS
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
     g->default_srvtab = SRVTAB;
-#endif /* HAVE_KERBEROS */
-#if defined( HAVE_LWP )
-    g->tsl_list = NULL;
-    mon_create( &g->tsl_mon ); 
-#endif /* HAVE_LWP */
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */
 
     return g;
 }