diff options
author | nectar <nectar@FreeBSD.org> | 2005-02-25 05:39:05 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2005-02-25 05:39:05 +0000 |
commit | 78a59572b356f941f9bcb853dafb34829ec8e576 (patch) | |
tree | 4a7be4ade5df61ca3631c0937c1fc399944ea1cc /crypto/openssl/crypto/o_time.c | |
parent | a55ec1447ad1b73694515ed74d03a045fdf79313 (diff) | |
download | FreeBSD-src-78a59572b356f941f9bcb853dafb34829ec8e576.zip FreeBSD-src-78a59572b356f941f9bcb853dafb34829ec8e576.tar.gz |
Vendor import of OpenSSL 0.9.7e.
Diffstat (limited to 'crypto/openssl/crypto/o_time.c')
-rw-r--r-- | crypto/openssl/crypto/o_time.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/crypto/openssl/crypto/o_time.c b/crypto/openssl/crypto/o_time.c index 7854681..e29091d 100644 --- a/crypto/openssl/crypto/o_time.c +++ b/crypto/openssl/crypto/o_time.c @@ -114,16 +114,28 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) return NULL; logvalue[reslen] = '\0'; + t = *timer; + +/* The following is extracted from the DEC C header time.h */ +/* +** Beginning in OpenVMS Version 7.0 mktime, time, ctime, strftime +** have two implementations. One implementation is provided +** for compatibility and deals with time in terms of local time, +** the other __utc_* deals with time in terms of UTC. +*/ +/* We use the same conditions as in said time.h to check if we should + assume that t contains local time (and should therefore be adjusted) + or UTC (and should therefore be left untouched). */ +#if __CRTL_VER < 70000000 || defined _VMS_V6_SOURCE /* Get the numerical value of the equivalence string */ status = atoi(logvalue); /* and use it to move time to GMT */ - t = *timer - status; + t -= status; +#endif /* then convert the result to the time structure */ -#ifndef OPENSSL_THREADS - ts=(struct tm *)localtime(&t); -#else + /* Since there was no gmtime_r() to do this stuff for us, we have to do it the hard way. */ { @@ -198,7 +210,6 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) result->tm_isdst = 0; /* There's no way to know... */ ts = result; -#endif } } #endif |