From aa326086cc4924110cdd0a935d26c519ed1335ba Mon Sep 17 00:00:00 2001 From: cnauroth Date: Wed, 1 Apr 2015 11:40:09 -0700 Subject: [PATCH] HADOOP-11787. OpensslSecureRandom.c pthread_threadid_np usage signature is wrong on 32-bit Mac. Contributed by Kiran Kumar M R. (cherry picked from commit a3a96a07faf0c6f6aa3ed33608271c2b1657e437) (cherry picked from commit 726024faa5c14bcdb31ee3ca9afd6a700e813f7f) --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 399a22bb95c..e00bb2ca779 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -713,6 +713,9 @@ Release 2.7.0 - UNRELEASED HADOOP-11754. RM fails to start in non-secure mode due to authentication filter failure. (wheat9) + HADOOP-11787. OpensslSecureRandom.c pthread_threadid_np usage signature is + wrong on 32-bit Mac. (Kiran Kumar M R via cnauroth) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c index 8f0c06d17a1..26e1fa623e8 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c @@ -286,7 +286,9 @@ static unsigned long pthreads_thread_id(void) #elif defined(__sun) thread_id = (unsigned long)pthread_self(); #elif defined(__APPLE__) - (void)pthread_threadid_np(pthread_self(), &thread_id); + __uint64_t tmp_thread_id; + (void)pthread_threadid_np(pthread_self(), &tmp_thread_id); + thread_id = (unsigned long)tmp_thread_id; #else #error "Platform not supported" #endif