From 145338bc44db62e3a901d1611e889a783e494d78 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Sat, 18 Feb 2012 21:05:06 +0000 Subject: [PATCH] HADOOP-7680 TestHardLink fails on Mac OS X, when gnu stat is in path. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1290868 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/fs/HardLink.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 310b6ae494..15569f5e15 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -209,6 +209,9 @@ Release 0.23.2 - UNRELEASED HADOOP-8057 hadoop-setup-conf.sh not working because of some extra spaces. (Vinayakumar B via stevel) + HADOOP-7680 TestHardLink fails on Mac OS X, when gnu stat is in path. + (Milind Bhandarkar via stevel) + Release 0.23.1 - 2012-02-17 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java index e078aaa8c3..eba1e0c6c8 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java @@ -64,7 +64,7 @@ public enum OSType { //override getLinkCountCommand for the particular Unix variant //Linux is already set as the default - {"stat","-c%h", null} if (osType == OSType.OS_TYPE_MAC) { - String[] linkCountCmdTemplate = {"stat","-f%l", null}; + String[] linkCountCmdTemplate = {"/usr/bin/stat","-f%l", null}; HardLinkCGUnix.setLinkCountCmdTemplate(linkCountCmdTemplate); } else if (osType == OSType.OS_TYPE_SOLARIS) { String[] linkCountCmdTemplate = {"ls","-l", null};