summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-31 19:23:10 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-31 19:23:10 (GMT)
commitc4e819a54f95ffc761ccedb680a39ce869a4ec2b (patch)
tree155512c7bae6ee56fec67b14678675b3a32b7aea /Modules/socketmodule.c
parent41290a68baa41b82711ca24a145e624f9d31cf86 (diff)
downloadcpython-c4e819a54f95ffc761ccedb680a39ce869a4ec2b.zip
cpython-c4e819a54f95ffc761ccedb680a39ce869a4ec2b.tar.gz
cpython-c4e819a54f95ffc761ccedb680a39ce869a4ec2b.tar.bz2
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().
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index ab3e913..211e77b 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -2485,7 +2485,7 @@ internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen,
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 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
return NULL;
if (res != 0) {
#ifdef MS_WINDOWS
- /* getsockopt also clears WSAGetLastError,
- so reset it back. */
WSASetLastError(res);
#else
errno = res;