From: Simon Tatham Date: Wed, 14 Nov 2012 18:32:09 +0000 (+0000) Subject: Fix another error-reporting bug, in which sk_newlistener would fail to X-Git-Tag: 0.63~115 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=3e22c99c9a3c28e042f2dc3a50fadf95e7c277e7;hp=06b51312c1ec70e9120c41f7b09f560ebacc6e35;p=PuTTY.git Fix another error-reporting bug, in which sk_newlistener would fail to capture the error code if listen() returned an error, and instead pass 0 (saved from the previous successful bind) to winsock_error_string. [originally from svn r9708] --- diff --git a/windows/winnet.c b/windows/winnet.c index 3a791116..c73ace98 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -1289,7 +1289,7 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, if (p_listen(s, SOMAXCONN) == SOCKET_ERROR) { p_closesocket(s); - ret->error = winsock_error_string(err); + ret->error = winsock_error_string(p_WSAGetLastError()); return (Socket) ret; }