From 3e22c99c9a3c28e042f2dc3a50fadf95e7c277e7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 14 Nov 2012 18:32:09 +0000 Subject: [PATCH] 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] --- windows/winnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.45.2