tor-android/external/fix_android_0.2.6.4rc_build...

78 lines
2.1 KiB
Diff
Raw Normal View History

From ed6a98b39661a204eb0186267bf406469b4e51ba Mon Sep 17 00:00:00 2001
From: n8fr8 <nathan@freitas.net>
Date: Wed, 18 Mar 2015 17:07:49 -0400
Subject: [PATCH 1/2] disable setting of MONOTONIC time on Android (it doesn't
work)
---
src/common/compat_pthreads.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c
index f4a6cad..ccacef1 100644
--- a/src/common/compat_pthreads.c
+++ b/src/common/compat_pthreads.c
@@ -181,6 +181,7 @@ tor_cond_init(tor_cond_t *cond)
return -1;
}
+#ifndef __ANDROID_API__
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
/* Use monotonic time so when we timedwait() on it, any clock adjustment
* won't affect the timeout value. */
@@ -188,6 +189,7 @@ tor_cond_init(tor_cond_t *cond)
return -1;
}
#endif
+#endif
if (pthread_cond_init(&cond->cond, &condattr)) {
return -1;
}
--
1.9.1
From 4257a9f1fbbc05413077b7b70215622099f667df Mon Sep 17 00:00:00 2001
From: n8fr8 <nathan@freitas.net>
Date: Wed, 18 Mar 2015 17:08:14 -0400
Subject: [PATCH 2/2] you must explicitly include limits.h on Android
---
src/ext/trunnel/trunnel.c | 1 +
src/trunnel/trunnel-local.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/src/ext/trunnel/trunnel.c b/src/ext/trunnel/trunnel.c
index 7353237..1d4403c 100644
--- a/src/ext/trunnel/trunnel.c
+++ b/src/ext/trunnel/trunnel.c
@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include "trunnel-impl.h"
+#include "limits.h"
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
diff --git a/src/trunnel/trunnel-local.h b/src/trunnel/trunnel-local.h
index b7c2ab9..e55cf3c 100644
--- a/src/trunnel/trunnel-local.h
+++ b/src/trunnel/trunnel-local.h
@@ -5,6 +5,7 @@
#include "util.h"
#include "compat.h"
#include "crypto.h"
+#include "limits.h"
#define trunnel_malloc tor_malloc
#define trunnel_calloc tor_calloc
@@ -15,4 +16,5 @@
#define trunnel_assert tor_assert
#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
+
#endif
--
1.9.1