From 3ccb3a3ce396bdff7038d2f10ecd128b5277638b Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 26 Jul 2011 18:40:38 -0400 Subject: [PATCH] Don't invoke libc uname() on non-Unix systems --- mcs/class/System/System/Platform.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mcs/class/System/System/Platform.cs b/mcs/class/System/System/Platform.cs index a953e83a31c..823063b5624 100644 --- a/mcs/class/System/System/Platform.cs +++ b/mcs/class/System/System/Platform.cs @@ -23,6 +23,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System; using System.Runtime.InteropServices; namespace System { @@ -35,6 +36,9 @@ namespace System { public static bool IsMacOS { get { + if (Environment.OSVersion.Platform != PlatformID.Unix) + return false; + if (!checkedIsMacOS) { IntPtr buf = Marshal.AllocHGlobal (8192); if (uname (buf) == 0) { -- 2.25.1