Fix macosx build broken by the VersionTuple refactor
authorPavel Labath <labath@google.com>
Mon, 18 Jun 2018 16:10:20 +0000 (16:10 +0000)
committerPavel Labath <labath@google.com>
Mon, 18 Jun 2018 16:10:20 +0000 (16:10 +0000)
I actually did check that macos builds before committing, but this error
was in conditionally compiled code that did not seem to be used on my
machine.

I also fix a typo in the previous speculative NetBSD patch.

llvm-svn: 334955

lldb/source/Host/macosx/objcxx/Host.mm
lldb/source/Host/netbsd/HostInfoNetBSD.cpp

index c8d441b..504ed10 100644 (file)
@@ -851,14 +851,11 @@ static short GetPosixspawnFlags(const ProcessLaunchInfo &launch_info) {
   if (g_use_close_on_exec_flag == eLazyBoolCalculate) {
     g_use_close_on_exec_flag = eLazyBoolNo;
 
-    uint32_t major, minor, update;
-    if (HostInfo::GetOSVersion(major, minor, update)) {
+    llvm::VersionTuple version = HostInfo::GetOSVersion();
+    if (version > llvm::VersionTuple(10, 7)) {
       // Kernel panic if we use the POSIX_SPAWN_CLOEXEC_DEFAULT on 10.7 or
       // earlier
-      if (major > 10 || (major == 10 && minor > 7)) {
-        // Only enable for 10.8 and later OS versions
-        g_use_close_on_exec_flag = eLazyBoolYes;
-      }
+      g_use_close_on_exec_flag = eLazyBoolYes;
     }
   }
 #else
index ff0cec7..dfbce31 100644 (file)
@@ -26,7 +26,7 @@ llvm::VersionTuple HostInfoNetBSD::GetOSVersion() {
 
   ::memset(&un, 0, sizeof(un));
   if (::uname(&un) < 0)
-    return VersionTuple();
+    return llvm::VersionTuple();
 
   /* Accept versions like 7.99.21 and 6.1_STABLE */
   uint32_t major, minor, update;