ソースを参照

Don't invoke libc uname() on non-Unix systems

Jeffrey Stedfast 14 年 前
コミット
3ccb3a3ce3
1 ファイル変更4 行追加0 行削除
  1. 4 0
      mcs/class/System/System/Platform.cs

+ 4 - 0
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) {