[Python-checkins] cpython: Issue #23618: Cleanup internal_connect() in socketmodule.c

victor.stinner python-checkins at python.org
Tue Mar 31 21:37:42 CEST 2015


https://hg.python.org/cpython/rev/d9374864d4a9
changeset: 95334:d9374864d4a9
user: Victor Stinner <victor.stinner at gmail.com>
date: Tue Mar 31 21:23:10 2015 +0200
summary:
 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().
files:
 Modules/socketmodule.c | 4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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;
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /