From 2d805c0b1825855f0416f9f94ebb98a1a221a71c Mon Sep 17 00:00:00 2001
From: Chad Metcalf <chad@cloudera.com>
Date: Thu, 28 Jan 2010 17:23:13 -0800
Subject: [PATCH] HADOOP-6453.  Hadoop wrapper script shouldn't ignore an existing JAVA_LIBRARY_PATH.

---
 bin/hadoop |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/bin/hadoop b/bin/hadoop
index 273549f..af3db20 100755
--- a/bin/hadoop
+++ b/bin/hadoop
@@ -251,14 +251,19 @@ if $cygwin; then
   HADOOP_HOME=`cygpath -w "$HADOOP_HOME"`
   HADOOP_LOG_DIR=`cygpath -w "$HADOOP_LOG_DIR"`
   TOOL_PATH=`cygpath -p -w "$TOOL_PATH"`
+  JAVA_LIBRARY_PATH=`cygpath -p -w "$JAVA_LIBRARY_PATH"`
 fi
+
 # setup 'java.library.path' for native-hadoop code if necessary
-JAVA_LIBRARY_PATH=''
 if [ -d "${HADOOP_HOME}/build/native" -o -d "${HADOOP_HOME}/lib/native" ]; then
   JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} -Xmx32m org.apache.hadoop.util.PlatformName | sed -e "s/ /_/g"`
-  
+ 
   if [ -d "$HADOOP_HOME/build/native" ]; then
-    JAVA_LIBRARY_PATH=${HADOOP_HOME}/build/native/${JAVA_PLATFORM}/lib
+    if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
+        JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:${HADOOP_HOME}/build/native/${JAVA_PLATFORM}/lib
+    else
+        JAVA_LIBRARY_PATH=${HADOOP_HOME}/build/native/${JAVA_PLATFORM}/lib
+    fi
   fi
   
   if [ -d "${HADOOP_HOME}/lib/native" ]; then
-- 
1.6.0.4

