From e1421384bd27ca28235f5c761c2bae38ddafb7de Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 3 Jan 2017 17:05:26 +0100 Subject: [PATCH] [System] Warnings cleanup --- mcs/class/System/System.Net.NetworkInformation/Ping.cs | 2 +- mcs/class/System/System/Platform.cs | 5 ++++- mcs/class/referencesource/System/net/System/Net/webproxy.cs | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mcs/class/System/System.Net.NetworkInformation/Ping.cs b/mcs/class/System/System.Net.NetworkInformation/Ping.cs index c69388a5807..1d2786002e1 100644 --- a/mcs/class/System/System.Net.NetworkInformation/Ping.cs +++ b/mcs/class/System/System.Net.NetworkInformation/Ping.cs @@ -71,6 +71,7 @@ namespace System.Net.NetworkInformation { #endif }; static readonly string PingBinPath; + static bool canSendPrivileged; #endif const int default_timeout = 4000; // 4 sec. ushort identifier; @@ -80,7 +81,6 @@ namespace System.Net.NetworkInformation { const UInt32 linux_cap_version = 0x20071026; static readonly byte [] default_buffer = new byte [0]; - static bool canSendPrivileged; BackgroundWorker worker; diff --git a/mcs/class/System/System/Platform.cs b/mcs/class/System/System/Platform.cs index b687c590f58..8afd40370cd 100644 --- a/mcs/class/System/System/Platform.cs +++ b/mcs/class/System/System/Platform.cs @@ -30,14 +30,17 @@ namespace System { internal static class Platform { static bool checkedOS; static bool isMacOS; - static bool isFreeBSD; #if MONOTOUCH || XAMMAC + const bool isFreeBSD = false; + private static void CheckOS() { isMacOS = true; checkedOS = true; } #else + static bool isFreeBSD; + [DllImport ("libc")] static extern int uname (IntPtr buf); diff --git a/mcs/class/referencesource/System/net/System/Net/webproxy.cs b/mcs/class/referencesource/System/net/System/Net/webproxy.cs index 15840cd7022..e433783951c 100644 --- a/mcs/class/referencesource/System/net/System/Net/webproxy.cs +++ b/mcs/class/referencesource/System/net/System/Net/webproxy.cs @@ -513,15 +513,17 @@ namespace System.Net { var data = AndroidPlatform.GetDefaultProxy (); if (data != null) return data; + + return new WebProxy (true); #else if (Platform.IsMacOS) { var data = Mono.Net.CFNetwork.GetDefaultProxy (); if (data != null) return data; } -#endif return new WebProxy (true); +#endif } #endif -- 2.11.4.GIT