projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #5140 from alexrp/profiler-stress-fpe-fix
[mono.git]
/
mono
/
btls
/
btls-util.c
diff --git
a/mono/btls/btls-util.c
b/mono/btls/btls-util.c
index 824b101f34c50ed68b88fd0e804a050ed7add745..955b8c85aec4fa4eea5ae2bc972c0b88bdaa23e4 100644
(file)
--- a/
mono/btls/btls-util.c
+++ b/
mono/btls/btls-util.c
@@
-8,32
+8,33
@@
#include <btls-util.h>
#include <assert.h>
#include <btls-util.h>
#include <assert.h>
-#include <time.h>
-
-#if defined(__ANDROID__) && !defined(__LP64__)
-#include <time64.h>
-extern time_t timegm (struct tm* const t);
-#endif
+// #include <time.h>
extern int asn1_generalizedtime_to_tm (struct tm *tm, const ASN1_GENERALIZEDTIME *d);
extern int asn1_generalizedtime_to_tm (struct tm *tm, const ASN1_GENERALIZEDTIME *d);
+extern int64_t btls_timegm64 (const struct tm *date);
+
+
MONO_API void
mono_btls_free (void *data)
{
OPENSSL_free (data);
}
MONO_API void
mono_btls_free (void *data)
{
OPENSSL_free (data);
}
-long
+int64_t
mono_btls_util_asn1_time_to_ticks (ASN1_TIME *time)
{
ASN1_GENERALIZEDTIME *gtime;
struct tm tm;
mono_btls_util_asn1_time_to_ticks (ASN1_TIME *time)
{
ASN1_GENERALIZEDTIME *gtime;
struct tm tm;
- time_t epoch;
+ int64_t epoch;
+
+ memset (&tm, 0, sizeof (tm));
gtime = ASN1_TIME_to_generalizedtime (time, NULL);
gtime = ASN1_TIME_to_generalizedtime (time, NULL);
+ /* FIXME: check return value of asn1_generalizedtime_to_tm () */
asn1_generalizedtime_to_tm (&tm, gtime);
ASN1_GENERALIZEDTIME_free (gtime);
asn1_generalizedtime_to_tm (&tm, gtime);
ASN1_GENERALIZEDTIME_free (gtime);
- epoch =
timegm
(&tm);
+ epoch =
btls_timegm64
(&tm);
return epoch;
}
return epoch;
}