changeset: 95334:d9374864d4a9 user: Victor Stinner date: Tue Mar 31 21:23:10 2015 +0200 files: Modules/socketmodule.c description: Issue #23618: Cleanup internal_connect() in socketmodule.c On Windows, it looks like using the C type socklen_t for getsockopt() (instead of int) is fine, it was already used in socket.getsockopt(). diff -r b75160d24b7b -r d9374864d4a9 Modules/socketmodule.c --- a/Modules/socketmodule.c Tue Mar 31 08:12:23 2015 -0700 +++ b/Modules/socketmodule.c Tue Mar 31 21:23:10 2015 +0200 @@ -2485,7 +2485,7 @@ else if (timeout == 0) { socklen_t res_size = sizeof res; if (!getsockopt(s->sock_fd, SOL_SOCKET, SO_ERROR, - (char*)&res, &res_size)) { + (void *)&res, &res_size)) { if (res == EISCONN) res = 0; err = res; @@ -2533,8 +2533,6 @@ return NULL; if (res != 0) { #ifdef MS_WINDOWS - /* getsockopt also clears WSAGetLastError, - so reset it back. */ WSASetLastError(res); #else errno = res;