[w32error] Add ENODEV -> ERROR_DEV_NOT_EXIST error translation (#5385)
authorLudovic Henry <ludovic@xamarin.com>
Thu, 17 Aug 2017 17:03:40 +0000 (19:03 +0200)
committerGitHub <noreply@github.com>
Thu, 17 Aug 2017 17:03:40 +0000 (19:03 +0200)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58738

mcs/class/System/ReferenceSources/Win32Exception.cs
mono/metadata/w32error-unix.c
mono/metadata/w32error.h

index d5b1e3863d6a490fd850c1deae055f0429bdcbda..a18b9fba8f695be595e34687b92949f3dd80fb69 100644 (file)
@@ -46,6 +46,7 @@ namespace System.ComponentModel
                        case 32: /* ERROR_SHARING_VIOLATION */ return "Sharing violation";
                        case 33: /* ERROR_LOCK_VIOLATION */ return "Lock violation";
                        case 50: /* ERROR_NOT_SUPPORTED */ return "Operation not supported";
+                       case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
                        case 87: /* ERROR_INVALID_PARAMETER */ return "Invalid parameter";
                        case 120: /* ERROR_CALL_NOT_IMPLEMENTED */ return "Call not implemented";
                        case 123: /* ERROR_INVALID_NAME */ return "Invalid name";
@@ -143,7 +144,6 @@ namespace System.ComponentModel
                        case 52: /* ERROR_DUP_NAME */ return "Duplicate name";
                        case 53: /* ERROR_BAD_NETPATH */ return "Bad netpath";
                        case 54: /* ERROR_NETWORK_BUSY */ return "Network busy";
-                       case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
                        case 56: /* ERROR_TOO_MANY_CMDS */ return "Too many commands";
                        case 57: /* ERROR_ADAP_HDW_ERR */ return "ADAP HDW error";
                        case 58: /* ERROR_BAD_NET_RESP */ return "Bad net response";
index df41473dfe896fbc0e1fbe07c82f20b00a360eeb..d25681126a4be13107c66a64fc52b24bb9dadcca 100644 (file)
@@ -66,6 +66,9 @@ mono_w32error_unix_to_win32 (guint32 error)
        case EINTR: return ERROR_IO_PENDING; /* best match I could find */
        case EPIPE: return ERROR_WRITE_FAULT;
        case ELOOP: return ERROR_CANT_RESOLVE_FILENAME;
+#ifdef ENODEV
+       case ENODEV: return ERROR_DEV_NOT_EXIST;
+#endif
 
        default:
                g_error ("%s: unknown error (%d) \"%s\"", __FILE__, error, g_strerror (error));
index bd42451469ffb2bdc511c9262e2b6c0312f4cf81..e66f920b42addefdad06be3418b8107774730673 100644 (file)
@@ -31,6 +31,7 @@
 #define ERROR_LOCK_VIOLATION       33
 #define ERROR_HANDLE_DISK_FULL     39
 #define ERROR_NOT_SUPPORTED        50
+#define ERROR_DEV_NOT_EXIST        55
 #define ERROR_FILE_EXISTS          80
 #define ERROR_CANNOT_MAKE          82
 #define ERROR_INVALID_PARAMETER    87