Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lambdageek
Copy link
Member

These aren't a perfect match, but better than falling into the default case
where Mono asserts and crashes.

Addresses part of #16024


Also add WSA_INVALID_PARAMETER and WSA_INVALID_HANDLE defines

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 CoffeeFlux self-requested a review August 20, 2019 18:41
Copy link
Contributor

@CoffeeFlux CoffeeFlux left a 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. */
Copy link
Contributor

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. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this over WSAEBADF?

Copy link
Member Author

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.

@lambdageek lambdageek merged commit ed0063b into mono:master Aug 20, 2019
@lambdageek
Copy link
Member Author

@monojenkins backport to 2019-08
@monojenkins backport to 2019-06

akoeplinger pushed a commit that referenced this pull request Aug 26, 2019
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants