From e40ec58ab279d0c7bc1874424b78b371a297b8f5 Mon Sep 17 00:00:00 2001
From: Kurt Zeilenga <kurt@openldap.org>
Date: Wed, 21 Oct 1998 21:56:38 +0000
Subject: [PATCH] import localtime -> gmtime change from -devel

---
 servers/slapd/add.c     |  5 +++--
 servers/slapd/modify.c  |  5 +++--
 servers/slapd/monitor.c | 15 +++++++++------
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/servers/slapd/add.c b/servers/slapd/add.c
index feecf522b5..7d31bc8744 100644
--- a/servers/slapd/add.c
+++ b/servers/slapd/add.c
@@ -186,10 +186,11 @@ add_created_attrs( Operation *op, Entry *e )
 	attr_merge( e, "creatorsname", bvals );
 
 	pthread_mutex_lock( &currenttime_mutex );
-	ltm = localtime( &currenttime );
-#ifdef LDAP_Y2K
+#ifndef LDAP_LOCALTIME
+	ltm = gmtime( &currenttime );
 	strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
 #else
+	ltm = localtime( &currenttime );
 	strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
 	pthread_mutex_unlock( &currenttime_mutex );
diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c
index 8c03510460..2820a3ed19 100644
--- a/servers/slapd/modify.c
+++ b/servers/slapd/modify.c
@@ -253,10 +253,11 @@ add_lastmods( Operation *op, LDAPMod **mods )
 	*mods = tmp;
 
 	pthread_mutex_lock( &currenttime_mutex );
-	ltm = localtime( &currenttime );
-#ifdef LDAP_Y2K
+#ifndef LDAP_LOCALTIME
+	ltm = gmtime( &currenttime );
 	strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
 #else
+	ltm = localtime( &currenttime );
 	strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
 	pthread_mutex_unlock( &currenttime_mutex );
diff --git a/servers/slapd/monitor.c b/servers/slapd/monitor.c
index 66c6494e5c..c43b61ac46 100644
--- a/servers/slapd/monitor.c
+++ b/servers/slapd/monitor.c
@@ -95,10 +95,11 @@ monitor_info( Connection *conn, Operation *op )
 				nreadwaiters++;
 			}
 			pthread_mutex_lock( &currenttime_mutex );
-			ltm = localtime( &c[i].c_starttime );
-#ifdef LDAP_Y2K
+#ifndef LDAP_LOCALTIME
+			ltm = gmtime( &c[i].c_starttime );
 			strftime( buf2, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
 #else
+			ltm = localtime( &c[i].c_starttime );
 			strftime( buf2, sizeof(buf2), "%y%m%d%H%M%SZ", ltm );
 #endif
 			pthread_mutex_unlock( &currenttime_mutex );
@@ -163,10 +164,11 @@ monitor_info( Connection *conn, Operation *op )
 	attr_merge( e, "bytessent", vals );
 
 	pthread_mutex_lock( &currenttime_mutex );
-	ltm = localtime( &currenttime );
-#ifdef LDAP_Y2K
+#ifndef LDAP_LOCALTIME
+	ltm = gmtime( &currenttime );
 	strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
 #else
+	ltm = localtime( &currenttime );
 	strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
 	pthread_mutex_unlock( &currenttime_mutex );
@@ -175,10 +177,11 @@ monitor_info( Connection *conn, Operation *op )
 	attr_merge( e, "currenttime", vals );
 
 	pthread_mutex_lock( &currenttime_mutex );
-	ltm = localtime( &starttime );
-#ifdef LDAP_Y2K
+#ifndef LDAP_LOCALTIME
+	ltm = gmtime( &starttime );
 	strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
 #else
+	ltm = localtime( &starttime );
 	strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
 	pthread_mutex_unlock( &currenttime_mutex );
-- 
GitLab