-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[w32socket] Translate some errno codes to WSA_ errors imprecisely. #16331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These aren't a perfect match, but better than falling into the `default` case where Mono asserts and crashes. Addresses part of mono#16024
CoffeeFlux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of WSAEINVAL and WSA_INVALID_PARAMETER here seems a little suspect, but I guess options are limited.
| #ifdef ECONNRESET | ||
| case ECONNRESET: return WSAECONNRESET; | ||
| #endif | ||
| case EDOM: return WSAEINVAL; /* not a precise match, best wecan do. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: space needed in "wecan".
| case EINTR: return WSAEINTR; | ||
| case EINVAL: return WSAEINVAL; | ||
| /*FIXME: case EIO: return WSAE????; */ | ||
| case EIO: return WSA_INVALID_HANDLE; /* not a precise match, best we can do. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this over WSAEBADF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#16024 (comment) it's what w32error-unix.c does, kind of.
|
@monojenkins backport to 2019-08 |
…cisely. (#16489) * [w32socket] Translate some errno codes to WSA_ errors imprecisely. These aren't a perfect match, but better than falling into the `default` case where Mono asserts and crashes. Addresses part of #16024 * [w32error] Add WSA_INVALID_PARAMETER and WSA_INVALID_HANDLE Backport of #16331.
These aren't a perfect match, but better than falling into the
defaultcasewhere Mono asserts and crashes.
Addresses part of #16024
Also add
WSA_INVALID_PARAMETERandWSA_INVALID_HANDLEdefines