From 2f3ed504c1d5721185eb8244e7368df651ac72c1 Mon Sep 17 00:00:00 2001 From: Arpit Agarwal Date: Wed, 13 Aug 2014 20:01:21 +0000 Subject: [PATCH] HADOOP-10966. Hadoop Common native compilation broken in windows. (Contributed by David Villegas) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1617823 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 547f2318fe..6a0fbc596e 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -575,6 +575,9 @@ Release 2.6.0 - UNRELEASED HADOOP-10962. Flags for posix_fadvise are not valid in some architectures (David Villegas via Colin Patrick McCabe) + HADOOP-10966. Hadoop Common native compilation broken in windows. + (David Villegas via Arpit Agarwal) + Release 2.5.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c index fa95047394..d8538c8b0b 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c @@ -176,6 +176,7 @@ static void nioe_deinit(JNIEnv *env) { * If the value is not known, return the argument unchanged. */ static int map_fadvise_flag(jint flag) { +#ifdef HAVE_POSIX_FADVISE switch(flag) { case org_apache_hadoop_io_nativeio_NativeIO_POSIX_POSIX_FADV_NORMAL: return POSIX_FADV_NORMAL; @@ -198,6 +199,9 @@ static int map_fadvise_flag(jint flag) { default: return flag; } +#else + return flag; +#endif } /*