hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r644600 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/FileUtil.java
Date Fri, 04 Apr 2008 03:42:32 GMT
Author: omalley
Date: Thu Apr  3 20:42:32 2008
New Revision: 644600

URL: http://svn.apache.org/viewvc?rev=644600&view=rev
Log:
HADOOP-3161. Fix FIleUtil.HardLink.getLinkCount on Mac OS. Contributed by
Nigel.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileUtil.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=644600&r1=644599&r2=644600&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Apr  3 20:42:32 2008
@@ -452,6 +452,9 @@
     HADOOP-3010. Fix ConcurrentModificationException in ipc.Server.Responder.
     (rangadi)
 
+    HADOOP-3161. Fix FIleUtil.HardLink.getLinkCount on Mac OS. (nigel
+    via omalley)
+
 Release 0.16.2 - 2008-04-02
 
   BUG FIXES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileUtil.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileUtil.java?rev=644600&r1=644599&r2=644600&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileUtil.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileUtil.java Thu Apr  3 20:42:32 2008
@@ -463,7 +463,8 @@
     enum OSType {
       OS_TYPE_UNIX, 
       OS_TYPE_WINXP,
-      OS_TYPE_SOLARIS; 
+      OS_TYPE_SOLARIS,
+      OS_TYPE_MAC; 
     }
   
     private static String[] hardLinkCommand;
@@ -480,6 +481,10 @@
         hardLinkCommand = new String[] {"ln", null, null};
         getLinkCountCommand = new String[] {"ls","-l"};
         break;
+      case OS_TYPE_MAC:
+        hardLinkCommand = new String[] {"ln", null, null};
+        getLinkCountCommand = new String[] {"stat","-f%l"};
+        break;
       case OS_TYPE_UNIX:
       default:
         hardLinkCommand = new String[] {"ln", null, null};
@@ -493,6 +498,8 @@
         return OSType.OS_TYPE_WINXP;
       else if (osName.indexOf("SunOS") >= 0)
          return OSType.OS_TYPE_SOLARIS;
+      else if (osName.indexOf("Mac") >= 0)
+         return OSType.OS_TYPE_MAC;
       else
         return OSType.OS_TYPE_UNIX;
     }



Mime
View raw message