X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslurpd%2Fglobals.c;h=c935f75c2e43749e4ce5ed226613aa908d095e49;hb=0aebe2e51a250df46d4983e82107194be15caa81;hp=f8630323cbc0ea690d0654271ead0207ae45d836;hpb=42e0d83cb3a1a1c5b25183f1ab74ce7edbe25de7;p=openldap diff --git a/servers/slurpd/globals.c b/servers/slurpd/globals.c index f8630323cb..c935f75c2e 100644 --- a/servers/slurpd/globals.c +++ b/servers/slurpd/globals.c @@ -1,5 +1,18 @@ -/* - * Copyright (c) 1996 Regents of the University of Michigan. +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2004 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* Portions Copyright (c) 1996 Regents of the University of Michigan. * All rights reserved. * * Redistribution and use in source and binary forms are permitted @@ -9,27 +22,40 @@ * software without specific prior written permission. This software * is provided ``as is'' without express or implied warranty. */ +/* ACKNOWLEDGEMENTS: + * This work was originally developed by the University of Michigan + * (as part of U-MICH LDAP). + */ /* * globals.c - initialization code for global data */ +#include "portable.h" + #include +#include +#include + #include "slurp.h" #include "globals.h" Globals *sglob; int ldap_syslog = 0; +#ifdef LOG_DEBUG int ldap_syslog_level = LOG_DEBUG; +#else +int ldap_syslog_level = 0; +#endif int ldap_debug = 0; - /* * Initialize the globals */ -Globals *init_globals() +Globals * +init_globals( void ) { Globals *g; @@ -38,35 +64,39 @@ Globals *init_globals() return NULL; } +#ifdef HAVE_NT_SERVICE_MANAGER + g->slapd_configfile = ".\\slapd.conf"; + g->slurpd_rdir = ".\\replica"; +#else g->slapd_configfile = SLAPD_DEFAULT_CONFIGFILE; + g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR "/replica"; +#endif g->no_work_interval = DEFAULT_NO_WORK_INTERVAL; g->slurpd_shutdown = 0; g->num_replicas = 0; g->replicas = NULL; - g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR; 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->serverName = NULL; g->srpos = 0L; + g->version = 0; 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 KERBEROS +#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND g->default_srvtab = SRVTAB; -#endif /* KERBEROS */ -#if defined( THREAD_SUNOS4_LWP ) - g->tsl_list = NULL; - mon_create( &g->tsl_mon ); -#endif /* THREAD_SUNOS4_LWP */ +#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */ return g; }