summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>2014-04-17 13:29:09 +0000
committerderaadt <>2014-04-17 13:29:09 +0000
commita115dfee3f0547b4443eb6525ce97316669ab327 (patch)
tree9b2941a5edf4e35d10f110f502150197ac6c6e82 /src/lib
parent7ad1208f94a29e0dfdadce0acbd3031452d8c3b7 (diff)
downloadopenbsd-a115dfee3f0547b4443eb6525ce97316669ab327.tar.gz
openbsd-a115dfee3f0547b4443eb6525ce97316669ab327.tar.bz2
openbsd-a115dfee3f0547b4443eb6525ce97316669ab327.zip
OPENSSL_gmtime() is not a gmtime() wrapper. It is a gmtime_r().
Always trying to confuse people... ok guenther
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/o_time.c22
-rw-r--r--src/lib/libssl/src/crypto/o_time.c22
2 files changed, 8 insertions, 36 deletions
diff --git a/src/lib/libcrypto/o_time.c b/src/lib/libcrypto/o_time.c
index 44f7ba3b8c..83028356b9 100644
--- a/src/lib/libcrypto/o_time.c
+++ b/src/lib/libcrypto/o_time.c
@@ -63,24 +63,10 @@
63#include <string.h> 63#include <string.h>
64#include "o_time.h" 64#include "o_time.h"
65 65
66struct tm 66struct tm *
67*OPENSSL_gmtime(const time_t *timer, struct tm *result) { 67OPENSSL_gmtime(const time_t *timer, struct tm *result)
68 struct tm *ts = NULL; 68{
69 69 return gmtime_r(timer, result);
70#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)
71 /* should return &data, but doesn't on some systems,
72 so we don't even look at the return value */
73 gmtime_r(timer, result);
74 ts = result;
75#else
76 ts = gmtime(timer);
77 if (ts == NULL)
78 return NULL;
79
80 memcpy(result, ts, sizeof(struct tm));
81 ts = result;
82#endif
83 return ts;
84} 70}
85 71
86/* Take a tm structure and add an offset to it. This avoids any OS issues 72/* Take a tm structure and add an offset to it. This avoids any OS issues
diff --git a/src/lib/libssl/src/crypto/o_time.c b/src/lib/libssl/src/crypto/o_time.c
index 44f7ba3b8c..83028356b9 100644
--- a/src/lib/libssl/src/crypto/o_time.c
+++ b/src/lib/libssl/src/crypto/o_time.c
@@ -63,24 +63,10 @@
63#include <string.h> 63#include <string.h>
64#include "o_time.h" 64#include "o_time.h"
65 65
66struct tm 66struct tm *
67*OPENSSL_gmtime(const time_t *timer, struct tm *result) { 67OPENSSL_gmtime(const time_t *timer, struct tm *result)
68 struct tm *ts = NULL; 68{
69 69 return gmtime_r(timer, result);
70#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)
71 /* should return &data, but doesn't on some systems,
72 so we don't even look at the return value */
73 gmtime_r(timer, result);
74 ts = result;
75#else
76 ts = gmtime(timer);
77 if (ts == NULL)
78 return NULL;
79
80 memcpy(result, ts, sizeof(struct tm));
81 ts = result;
82#endif
83 return ts;
84} 70}
85 71
86/* Take a tm structure and add an offset to it. This avoids any OS issues 72/* Take a tm structure and add an offset to it. This avoids any OS issues