2009-01-08 Geoff Norton <gnorton@novell.com>
authorGeoff Norton <grompf@sublimeintervention.com>
Fri, 9 Jan 2009 02:32:27 +0000 (02:32 -0000)
committerGeoff Norton <grompf@sublimeintervention.com>
Fri, 9 Jan 2009 02:32:27 +0000 (02:32 -0000)
        * processes.c: Fix the osx version check to properly detect 10.5 v 10.4

svn path=/branches/mono-2-2/mono/; revision=122853

mono/io-layer/ChangeLog
mono/io-layer/processes.c

index 9347f4bfa966aeeb6bdfa92a38c5c40924c703da..c90bd0c1f9688f46a528bbb473283ae7a954f260 100644 (file)
@@ -1,3 +1,7 @@
+2009-01-08  Geoff Norton  <gnorton@novell.com>
+
+       * processes.c: Fix the osx version check to properly detect 10.5 v 10.4
+
 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
 
        Backport of r122672 - r122675.
index f3927532ce0bd6f1bd7c197d86bd787ab39eb558..0d12f904bc4de1f7921040deaaa618c81235e4a3 100644 (file)
@@ -398,7 +398,7 @@ utf16_concat (const gunichar2 *first, ...)
 #include <sys/utsname.h>
 
 /* 0 = no detection; -1 = not 10.5 or higher;  1 = 10.5 or higher */
-static int detected_osx_version;
+static int osx_10_5_or_higher;
 
 static void
 detect_osx_10_5_or_higher ()
@@ -408,38 +408,26 @@ detect_osx_10_5_or_higher ()
        int v;
        
        if (uname (&u) != 0){
-               detected_osx_version = 1;
+               osx_10_5_or_higher = 1;
                return;
        }
 
        p = u.release;
        v = atoi (p);
        
-       if (v < 9){
-               detected_osx_version = -1;
-       } else if (v > 9)
-               detected_osx_version = 1;
-       else {
-               while (*p && *p != '.')
-                       p++;
-               if (*p == '.'){
-                       p++;
-                       if (atoi (p) > 4){
-                               detected_osx_version = 1;
-                               return;
-                       }
-               }
-               detected_osx_version = -1;
-       }
+       if (v < 9)
+               osx_10_5_or_higher = -1;
+       else 
+               osx_10_5_or_higher = 1;
 }
 
 static gboolean
 is_macos_10_5_or_higher ()
 {
-       if (detected_osx_version == 0)
+       if (osx_10_5_or_higher == 0)
                detect_osx_10_5_or_higher ();
        
-       return detected_osx_version + 1;
+       return (osx_10_5_or_higher == 1);
 }
 #endif