harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r925695 - in /harmony/enhanced/classlib/trunk/modules: awt/src/main/java/common/java/awt/Toolkit.java awt/src/main/java/common/org/apache/harmony/awt/datatransfer/DTK.java misc/src/main/java/org/apache/harmony/misc/SystemUtils.java
Date Sat, 20 Mar 2010 22:09:46 GMT
Author: hindessm
Date: Sat Mar 20 22:09:45 2010
New Revision: 925695

URL: http://svn.apache.org/viewvc?rev=925695&view=rev
Log:
Minor fixes to help on freebsd.

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/datatransfer/DTK.java
    harmony/enhanced/classlib/trunk/modules/misc/src/main/java/org/apache/harmony/misc/SystemUtils.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java?rev=925695&r1=925694&r2=925695&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
Sat Mar 20 22:09:45 2010
@@ -495,7 +495,7 @@ public abstract class Toolkit {
     private static String getWTKClassName() {
         String osName = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
         String packageBase = "org.apache.harmony.awt.wtk", win = "windows", lin = "linux";
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        if (osName.startsWith(lin)) {
+        if (osName.startsWith(lin) || osName.startsWith("freebsd")) {
             return packageBase + "." + lin + ".LinuxWTK"; //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (osName.startsWith(win)) {

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/datatransfer/DTK.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/datatransfer/DTK.java?rev=925695&r1=925694&r2=925695&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/datatransfer/DTK.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/datatransfer/DTK.java
Sat Mar 20 22:09:45 2010
@@ -133,6 +133,7 @@ public abstract class DTK {
             name = "org.apache.harmony.awt.datatransfer.windows.WinDTK"; //$NON-NLS-1$
             break;
         case SystemUtils.OS_LINUX:
+        case SystemUtils.OS_FREEBSD:
             name = "org.apache.harmony.awt.datatransfer.linux.LinuxDTK"; //$NON-NLS-1$
             break;
         default:

Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/java/org/apache/harmony/misc/SystemUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/misc/src/main/java/org/apache/harmony/misc/SystemUtils.java?rev=925695&r1=925694&r2=925695&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/misc/src/main/java/org/apache/harmony/misc/SystemUtils.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/misc/src/main/java/org/apache/harmony/misc/SystemUtils.java
Sat Mar 20 22:09:45 2010
@@ -25,6 +25,7 @@ public class SystemUtils {
     // OSes
     public static final int OS_WINDOWS = 1;
     public static final int OS_LINUX = 2;
+    public static final int OS_FREEBSD = 3;
     public static final int OS_UNKNOWN = -1;
 
     // Architectures
@@ -38,7 +39,7 @@ public class SystemUtils {
 
     /**
      * getOS method returns on of the operating system codes:
-     * OS_WINDOWS, OS_LINUX or OS_UNKNOWN
+     * OS_WINDOWS, OS_LINUX, OS_FREEBSD or OS_UNKNOWN
      * @return Operating system code
      */
     public static int getOS() {
@@ -49,8 +50,13 @@ public class SystemUtils {
             } else {
                 if (osname.compareToIgnoreCase("lin") == 0) { //$NON-NLS-1$
                     os = OS_LINUX;
-                } else
-                    os = OS_UNKNOWN;
+                } else {
+                    if (osname.compareToIgnoreCase("fre") == 0) { //$NON-NLS-1$
+                        os = OS_FREEBSD;
+                    } else {
+                        os = OS_UNKNOWN;
+                    }
+                }
             }
         }
         return os;



Mime
View raw message