Skip to content

Commit 5ef7ea5

Browse files
author
Michael DeRoy
committed
Fix issue on android where HTTPClient.GetAsync will fail with libc error (case 935292)
1 parent e2d3ddd commit 5ef7ea5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

mcs/class/System/System.Net.NetworkInformation/IPGlobalProperties.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,17 @@ public override string DhcpScopeName {
5959
public override string DomainName {
6060
get {
6161
byte [] bytes = new byte [256];
62-
if (getdomainname (bytes, 256) != 0)
63-
throw new NetworkInformationException ();
62+
#if UNITY
63+
try
64+
{
65+
#endif
66+
if (getdomainname (bytes, 256) != 0)
67+
throw new NetworkInformationException ();
68+
#if UNITY
69+
} catch (EntryPointNotFoundException) {
70+
return String.Empty;
71+
}
72+
#endif
6473
int len = Array.IndexOf<byte> (bytes, 0);
6574
return Encoding.ASCII.GetString (bytes, 0, len < 0 ? 256 : len);
6675
}

0 commit comments

Comments
 (0)