]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/add.c
More header work toward draft-ietf-ldapext-ldap-c-api-01.
[openldap] / servers / slapd / add.c
index 93cc3cdcd3b3c74e7eab51c8c35d54632fc5bb19..110e3d365dd94715ee392feab4fab3d9d8241899 100644 (file)
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/socket.h>
+
 #include "slap.h"
 
 extern Backend *select_backend();
@@ -184,10 +187,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 );