summaryrefslogtreecommitdiff
path: root/src/c/openssl.c
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2015-10-24 11:07:55 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2015-10-24 11:07:55 -0400
commit3a29987afcd586c8d9300194752db045c868db17 (patch)
tree8c677160f79b3b041f5f622a7e57e0bee292d7dc /src/c/openssl.c
parent64a0fb65999c42c0d6923b25f43ef193b67a2aa6 (diff)
parent7d861ea0debf944cb8e3e38d73a8c0197de574b3 (diff)
Merge branch 'dfsg_clean'
Diffstat (limited to 'src/c/openssl.c')
-rw-r--r--src/c/openssl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/c/openssl.c b/src/c/openssl.c
index 6d018707..206a3bc8 100644
--- a/src/c/openssl.c
+++ b/src/c/openssl.c
@@ -34,9 +34,15 @@ static void random_password() {
}
// OpenSSL callbacks
+#ifdef PTHREAD_T_IS_POINTER
+# define CRYPTO_THREADID_SET CRYPTO_THREADID_set_pointer
+#else
+# define CRYPTO_THREADID_SET CRYPTO_THREADID_set_numeric
+#endif
static void thread_id(CRYPTO_THREADID *const result) {
- CRYPTO_THREADID_set_numeric(result, pthread_self());
+ CRYPTO_THREADID_SET(result, pthread_self());
}
+#undef CRYPTO_THREADID_SET
static void lock_or_unlock(const int mode, const int type, const char *file,
const int line) {
pthread_mutex_t *const lock = &openssl_locks[type];