From 40d4304e13d740e42c9b8a553ef518149effd8ce Mon Sep 17 00:00:00 2001 From: Jason Darrell Lowe Date: Tue, 17 Jun 2014 02:25:13 +0000 Subject: [PATCH] svn merge -c 1603042 FIXES: HADOOP-10699. Fix build native library on mac osx. Contributed by Binglin Chang git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1603043 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../hadoop/security/JniBasedUnixGroupsNetgroupMapping.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 3babf77bb76..1593f575ae8 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -225,6 +225,9 @@ Release 2.5.0 - UNRELEASED HADOOP-10702. KerberosAuthenticationHandler does not log the principal names correctly. (Benoy Antony via cnauroth) + HADOOP-10699. Fix build native library on mac osx (Binglin Chang via + jlowe) + BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS HADOOP-10520. Extended attributes definition and FileSystem APIs for diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.c index 1177d728221..de73a8ae683 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.c @@ -73,7 +73,10 @@ Java_org_apache_hadoop_security_JniBasedUnixGroupsNetgroupMapping_getUsersForNet // was successful or not (as long as it was called we need to call // endnetgrent) setnetgrentCalledFlag = 1; -#ifndef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__MACH__) + setnetgrent(cgroup); + { +#else if(setnetgrent(cgroup) == 1) { #endif current = NULL; @@ -90,9 +93,7 @@ Java_org_apache_hadoop_security_JniBasedUnixGroupsNetgroupMapping_getUsersForNet userListSize++; } } -#ifndef __FreeBSD__ } -#endif //-------------------------------------------------- // build return data (java array)