From 0befbba59617ad22ee64b2ba2d1b8d8af2e57bc3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 21 Apr 2021 16:19:58 +0300 Subject: [PATCH 46/46] Add errno mapping for Winsock error #10038 (WSAENOTSOCK) See osdn #42043 Signed-off-by: Marko Lindqvist --- utility/net_types.h | 4 +++- utility/netintf.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/utility/net_types.h b/utility/net_types.h index 431f3bea8b..d4fbb53489 100644 --- a/utility/net_types.h +++ b/utility/net_types.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,6 +36,7 @@ extern "C" { #undef EADDRNOTAVAIL #undef ETIMEDOUT #undef ECONNABORTED +#undef ENOTSOCK #define EINTR WSAEINTR #define EINPROGRESS WSAEWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK @@ -44,6 +45,7 @@ extern "C" { #define EADDRNOTAVAIL WSAEADDRNOTAVAIL #define ETIMEDOUT WSAETIMEDOUT #define ECONNABORTED WSAECONNABORTED +#define ENOTSOCK WSAENOTSOCK #endif /* FREECIV_HAVE_WINSOCK */ /* Which protocol will be used for LAN announcements */ diff --git a/utility/netintf.c b/utility/netintf.c index c2c5d024b1..935b6e86de 100644 --- a/utility/netintf.c +++ b/utility/netintf.c @@ -86,6 +86,7 @@ static void set_socket_errno(void) case WSAECONNREFUSED: case WSAETIMEDOUT: case WSAECONNABORTED: + case WSAENOTSOCK: errno = err; return; default: -- 2.30.2