From db1476e1cbcca16642779ee2ea4146b6f32910c3 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 14 Jul 2017 10:58:25 -0400 Subject: [PATCH] [w32error] Add ENXIO error case (#5199) Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58100 --- mcs/class/System/ReferenceSources/Win32Exception.cs | 1 + mono/metadata/w32error.h | 1 + mono/metadata/w32socket-unix.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/mcs/class/System/ReferenceSources/Win32Exception.cs b/mcs/class/System/ReferenceSources/Win32Exception.cs index f80d759f63d..d5b1e3863d6 100644 --- a/mcs/class/System/ReferenceSources/Win32Exception.cs +++ b/mcs/class/System/ReferenceSources/Win32Exception.cs @@ -1733,6 +1733,7 @@ namespace System.ComponentModel case 13882: /* ERROR_IPSEC_IKE_MM_LIMIT */ return "IPSEC IKE mm limit"; case 13883: /* ERROR_IPSEC_IKE_NEGOTIATION_DISABLED */ return "IPSEC IKE negotiation disabled"; case 13884: /* ERROR_IPSEC_IKE_NEG_STATUS_END */ return "IPSEC IKE neg status end"; + case 100001: /* WSAENXIO */ return "Device not configured"; #endif // MOBILE default: return string.Format ("mono-io-layer-error ({0})", error); diff --git a/mono/metadata/w32error.h b/mono/metadata/w32error.h index 439bdd81a2a..bd42451469f 100644 --- a/mono/metadata/w32error.h +++ b/mono/metadata/w32error.h @@ -76,6 +76,7 @@ #define WSAEHOSTDOWN 10064 #define WSAEHOSTUNREACH 10065 #define WSASYSCALLFAILURE 10107 +#define WSAENXIO 100001 #endif diff --git a/mono/metadata/w32socket-unix.c b/mono/metadata/w32socket-unix.c index 87743377324..5816b142b05 100644 --- a/mono/metadata/w32socket-unix.c +++ b/mono/metadata/w32socket-unix.c @@ -1324,6 +1324,9 @@ mono_w32socket_convert_error (gint error) case ENODEV: return WSAENETDOWN; #ifdef EPROTOTYPE case EPROTOTYPE: return WSAEPROTOTYPE; +#endif +#ifdef ENXIO + case ENXIO: return WSAENXIO; #endif default: g_error ("%s: no translation into winsock error for (%d) \"%s\"", __func__, error, g_strerror (error)); -- 2.25.1