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, 5 insertions, 16 deletions
diff --git a/src/lib/libcrypto/o_time.c b/src/lib/libcrypto/o_time.c
index e29091d650..785468131e 100644
--- a/src/lib/libcrypto/o_time.c
+++ b/src/lib/libcrypto/o_time.c
@@ -114,28 +114,16 @@ 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
130 /* Get the numerical value of the equivalence string */ 117 /* Get the numerical value of the equivalence string */
131 status = atoi(logvalue); 118 status = atoi(logvalue);
132 119
133 /* and use it to move time to GMT */ 120 /* and use it to move time to GMT */
134 t -= status; 121 t = *timer - status;
135#endif
136 122
137 /* then convert the result to the time structure */ 123 /* then convert the result to the time structure */
138 124#ifndef OPENSSL_THREADS
125 ts=(struct tm *)localtime(&t);
126#else
139 /* Since there was no gmtime_r() to do this stuff for us, 127 /* Since there was no gmtime_r() to do this stuff for us,
140 we have to do it the hard way. */ 128 we have to do it the hard way. */
141 { 129 {
@@ -210,6 +198,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
210 result->tm_isdst = 0; /* There's no way to know... */ 198 result->tm_isdst = 0; /* There's no way to know... */
211 199
212 ts = result; 200 ts = result;
201#endif
213 } 202 }
214 } 203 }
215#endif 204#endif