]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix another error-reporting bug, in which sk_newlistener would fail to
authorSimon Tatham <anakin@pobox.com>
Wed, 14 Nov 2012 18:32:09 +0000 (18:32 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 14 Nov 2012 18:32:09 +0000 (18:32 +0000)
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]

windows/winnet.c

index 3a791116d1517192b9ea25355806e8439feefefe..c73ace98128f99e296bd4fdd5c2dae1a041ccfb3 100644 (file)
@@ -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;
     }