Skip to content

Commit 9dfcaf4

Browse files
committed
Fix Darwin and FreeBSD OS type detection
Obtained in part from http://reviews.llvm.org/D6290 llvm-svn: 222136
1 parent 0178e75 commit 9dfcaf4

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lldb/scripts/utilsOsType.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
#--
2929
class EnumOsType( object ):
3030
values = [ "Unknown",
31-
"Windows",
31+
"Darwin",
32+
"FreeBSD",
3233
"Linux",
33-
"Darwin" ]; # OSX
34+
"Windows" ]
3435
class __metaclass__( type ):
3536
#++---------------------------------------------------------------------------
3637
# Details: Fn acts as an enumeration.
@@ -64,11 +65,13 @@ def determine_os_type():
6465
eOSType = EnumOsType.Unknown;
6566

6667
strOS = sys.platform
67-
if strOS == "win32":
68-
eOSType = EnumOsType.Windows;
69-
elif (strOS == "linux") or (strOS == "linux2"):
70-
eOSType = EnumOsType.Linux;
71-
elif strOS == "darwin":
72-
eOSType == EnumOsType.Darwin;
68+
if strOS == "darwin":
69+
eOSType = EnumOsType.Darwin
70+
elif (strOS.startswith("freebsd")):
71+
eOSType = EnumOsType.FreeBSD
72+
elif (strOS.startswith("linux")):
73+
eOSType = EnumOsType.Linux
74+
elif strOS == "win32":
75+
eOSType = EnumOsType.Windows
7376

7477
return eOSType;

0 commit comments

Comments
 (0)