From: deraadt Date: Thu, 17 Apr 2014 13:29:09 +0000 (+0000) Subject: OPENSSL_gmtime() is not a gmtime() wrapper. It is a gmtime_r(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=13a198f36d1d9331db2b4026046e2cf3ddc231da;p=openbsd OPENSSL_gmtime() is not a gmtime() wrapper. It is a gmtime_r(). Always trying to confuse people... ok guenther --- 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