aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_gentm.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2001-05-16 08:44:09 +0000
committerRichard Levitte <levitte@openssl.org>2001-05-16 08:44:09 +0000
commitb8e35bd66e4d3d94c10091f6773afc4314ffcc80 (patch)
treec3b6c21b1aea7b90058cd547cadfe1843aeec4db /crypto/asn1/a_gentm.c
parente8734731d3b39cf3f7fa6acb055d22e0bdc2a7ff (diff)
downloadopenssl-b8e35bd66e4d3d94c10091f6773afc4314ffcc80.tar.gz
New internal function OPENSSL_gmtime, which is intended to do the same
as gmtime_r() on the systems where that is defined.
Diffstat (limited to 'crypto/asn1/a_gentm.c')
-rw-r--r--crypto/asn1/a_gentm.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c
index 185d169600..ef95003510 100644
--- a/crypto/asn1/a_gentm.c
+++ b/crypto/asn1/a_gentm.c
@@ -61,6 +61,7 @@
#include <stdio.h>
#include <time.h>
#include "cryptlib.h"
+#include "o_time.h"
#include <openssl/asn1.h>
#if 0
@@ -193,21 +194,17 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
{
char *p;
struct tm *ts;
-#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32)
struct tm data;
-#endif
if (s == NULL)
s=M_ASN1_GENERALIZEDTIME_new();
if (s == NULL)
return(NULL);
-#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32)
- gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
- ts=&data;
-#else
- ts=gmtime(&t);
-#endif
+ ts=OPENSSL_gmtime(&t, &data);
+ if (ts == NULL)
+ return(NULL);
+
p=(char *)s->data;
if ((p == NULL) || (s->length < 16))
{