summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/o_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/o_time.c')
-rw-r--r--src/lib/libcrypto/o_time.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/lib/libcrypto/o_time.c b/src/lib/libcrypto/o_time.c
index 785468131e..e29091d650 100644
--- a/src/lib/libcrypto/o_time.c
+++ b/src/lib/libcrypto/o_time.c
@@ -114,16 +114,28 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
114 return NULL; 114 return NULL;
115 logvalue[reslen] = '\0'; 115 logvalue[reslen] = '\0';
116 116
117 t = *timer;
118
119/* The following is extracted from the DEC C header time.h */
120/*
121** Beginning in OpenVMS Version 7.0 mktime, time, ctime, strftime
122** have two implementations. One implementation is provided
123** for compatibility and deals with time in terms of local time,
124** the other __utc_* deals with time in terms of UTC.
125*/
126/* We use the same conditions as in said time.h to check if we should
127 assume that t contains local time (and should therefore be adjusted)
128 or UTC (and should therefore be left untouched). */
129#if __CRTL_VER < 70000000 || defined _VMS_V6_SOURCE
117 /* Get the numerical value of the equivalence string */ 130 /* Get the numerical value of the equivalence string */
118 status = atoi(logvalue); 131 status = atoi(logvalue);
119 132
120 /* and use it to move time to GMT */ 133 /* and use it to move time to GMT */
121 t = *timer - status; 134 t -= status;
135#endif
122 136
123 /* then convert the result to the time structure */ 137 /* then convert the result to the time structure */
124#ifndef OPENSSL_THREADS 138
125 ts=(struct tm *)localtime(&t);
126#else
127 /* Since there was no gmtime_r() to do this stuff for us, 139 /* Since there was no gmtime_r() to do this stuff for us,
128 we have to do it the hard way. */ 140 we have to do it the hard way. */
129 { 141 {
@@ -198,7 +210,6 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
198 result->tm_isdst = 0; /* There's no way to know... */ 210 result->tm_isdst = 0; /* There's no way to know... */
199 211
200 ts = result; 212 ts = result;
201#endif
202 } 213 }
203 } 214 }
204#endif 215#endif