#include <string.h>
#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
#include <string.h>
#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