]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/globals.c
ITS#5376,ITS#5378
[openldap] / servers / slurpd / globals.c
index 5ff11118a0c2a8ba5dbbbb25ce804f2242ec8e5e..a918443a2d64b9d88e92a39e26e188f53f7e919f 100644 (file)
@@ -1,10 +1,18 @@
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2008 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
+ * <http://www.OpenLDAP.org/license.html>.
  */
-/*
- * Copyright (c) 1996 Regents of the University of Michigan.
+/* Portions Copyright (c) 1996 Regents of the University of Michigan.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted
  * 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
@@ -30,6 +42,7 @@
 #include "globals.h"
 
 Globals                 *sglob;
+static Globals glob;
 
 int ldap_syslog = 0;
 #ifdef LOG_DEBUG
@@ -47,10 +60,10 @@ init_globals( void )
 {
     Globals *g;
 
-    g = ( Globals * ) malloc( sizeof( Globals ));
-    if ( g == NULL ) {
-       return NULL;
-    }
+    g = &glob;
+
+       g->wake_sds[0] = -1;
+       g->wake_sds[1] = -1;
 
 #ifdef HAVE_NT_SERVICE_MANAGER
     g->slapd_configfile = ".\\slapd.conf";
@@ -59,11 +72,11 @@ init_globals( void )
     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;
-    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';
@@ -72,6 +85,7 @@ init_globals( void )
     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( EXIT_FAILURE );