summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravikozokin <kozokinavi@gmail.com>2019-12-02 20:12:51 +0200
committeravikozokin <kozokinavi@gmail.com>2019-12-02 20:12:51 +0200
commitfa8b54901f1236cbcd48205856e8766496664105 (patch)
tree6b654fa4eee7ad72d52861b8b0cb946bab8fc550
parentAuto merge of #64736 - Nashenas88:mir_predecessors_cache_cleanup, r=oli-obk (diff)
downloadrust-fa8b54901f1236cbcd48205856e8766496664105.tar.gz
rust-fa8b54901f1236cbcd48205856e8766496664105.tar.bz2
rust-fa8b54901f1236cbcd48205856e8766496664105.tar.xz
added correct error code for WSASocketW failure fallback
-rw-r--r--src/libstd/sys/windows/net.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/windows/net.rs b/src/libstd/sys/windows/net.rs
index 32f4011..2f2f285 100644
--- a/src/libstd/sys/windows/net.rs
+++ b/src/libstd/sys/windows/net.rs
@@ -100,7 +100,7 @@ impl Socket {
100 c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) { 100 c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) {
101 c::INVALID_SOCKET => { 101 c::INVALID_SOCKET => {
102 match c::WSAGetLastError() { 102 match c::WSAGetLastError() {
103 c::WSAEPROTOTYPE => { 103 c::WSAEPROTOTYPE | c::WSAEINVAL => {
104 match c::WSASocketW(fam, ty, 0, ptr::null_mut(), 0, 104 match c::WSASocketW(fam, ty, 0, ptr::null_mut(), 0,
105 c::WSA_FLAG_OVERLAPPED) { 105 c::WSA_FLAG_OVERLAPPED) {
106 c::INVALID_SOCKET => Err(last_error()), 106 c::INVALID_SOCKET => Err(last_error()),
@@ -199,7 +199,7 @@ impl Socket {
199 c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) { 199 c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) {
200 c::INVALID_SOCKET => { 200 c::INVALID_SOCKET => {
201 match c::WSAGetLastError() { 201 match c::WSAGetLastError() {
202 c::WSAEPROTOTYPE => { 202 c::WSAEPROTOTYPE | c::WSAEINVAL => {
203 match c::WSASocketW(info.iAddressFamily, 203 match c::WSASocketW(info.iAddressFamily,
204 info.iSocketType, 204 info.iSocketType,
205 info.iProtocol, 205 info.iProtocol,