From 13a198f36d1d9331db2b4026046e2cf3ddc231da Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 17 Apr 2014 13:29:09 +0000 Subject: [PATCH] OPENSSL_gmtime() is not a gmtime() wrapper. It is a gmtime_r(). Always trying to confuse people... ok guenther --- lib/libcrypto/o_time.c | 22 ++++------------------ lib/libssl/src/crypto/o_time.c | 22 ++++------------------ 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/lib/libcrypto/o_time.c b/lib/libcrypto/o_time.c index 44f7ba3b8c5..83028356b91 100644 --- a/lib/libcrypto/o_time.c +++ b/lib/libcrypto/o_time.c @@ -63,24 +63,10 @@ #include #include "o_time.h" -struct tm -*OPENSSL_gmtime(const time_t *timer, struct tm *result) { - struct tm *ts = NULL; - -#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_OS2) && (!defined(OPENSSL_SYS_VMS) || defined(gmtime_r)) && !defined(OPENSSL_SYS_MACOSX) && !defined(OPENSSL_SYS_SUNOS) - /* should return &data, but doesn't on some systems, - so we don't even look at the return value */ - gmtime_r(timer, result); - ts = result; -#else - ts = gmtime(timer); - if (ts == NULL) - return NULL; - - memcpy(result, ts, sizeof(struct tm)); - ts = result; -#endif - return ts; +struct tm * +OPENSSL_gmtime(const time_t *timer, struct tm *result) +{ + return gmtime_r(timer, result); } /* Take a tm structure and add an offset to it. This avoids any OS issues diff --git a/lib/libssl/src/crypto/o_time.c b/lib/libssl/src/crypto/o_time.c index 44f7ba3b8c5..83028356b91 100644 --- a/lib/libssl/src/crypto/o_time.c +++ b/lib/libssl/src/crypto/o_time.c @@ -63,24 +63,10 @@ #include #include "o_time.h" -struct tm -*OPENSSL_gmtime(const time_t *timer, struct tm *result) { - struct tm *ts = NULL; - -#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_OS2) && (!defined(OPENSSL_SYS_VMS) || defined(gmtime_r)) && !defined(OPENSSL_SYS_MACOSX) && !defined(OPENSSL_SYS_SUNOS) - /* should return &data, but doesn't on some systems, - so we don't even look at the return value */ - gmtime_r(timer, result); - ts = result; -#else - ts = gmtime(timer); - if (ts == NULL) - return NULL; - - memcpy(result, ts, sizeof(struct tm)); - ts = result; -#endif - return ts; +struct tm * +OPENSSL_gmtime(const time_t *timer, struct tm *result) +{ + return gmtime_r(timer, result); } /* Take a tm structure and add an offset to it. This avoids any OS issues -- 2.20.1