Skip to content
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

TEST: mingw_setsockopt #2417

Closed

Conversation

jeffhostetler
Copy link

@dscho I took your second round of changes and made a few tweaks to simplify calls
to WSAGetLastError().

Still need to squash and drop the fprintf/fflush.

dscho and others added 4 commits November 14, 2019 21:40
Noticed by Jeff Hostetler.

This closes git-for-windows#2404

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
TODO squash this and omit the fprintfs

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
The winsock2 library provides functions that work on different data
types than file descriptors, therefore we wrap them.

But that is not the only difference: they also do not set `errno` but
expect the callers to enquire about errors via `WSAGetLastError()`.

Let's translate that into appropriate `errno` values whenever the socket
operations fail so that Git's code base does not have to change its
expectations.

This closes git-for-windows#2404

Helped-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
@jeffhostetler
Copy link
Author

See also #2405

@dscho
Copy link
Member

dscho commented Nov 25, 2019

Good point about the set_wsa_errno() function. I incorporated your changes in #2405 (comment), guarding the fprintf() behind the DEBUG_WSA_ERRNO constant.

@dscho
Copy link
Member

dscho commented Nov 26, 2019

I integrated the changes into #2405.

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.

None yet

2 participants