From b5c8c48ea39ee98b0d5109df52ea48f0201e49fc Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 22 Apr 2021 04:54:14 +0300 Subject: [PATCH 21/23] Improve comments about mapping Winsock errors to errno - Correct set_socket_errno() comment to point to net_types.h where the mapping currently lives - Add cross-reference comment to net_types.h about set_socket_errno() See osdn #42045 Signed-off-by: Marko Lindqvist --- utility/net_types.h | 5 +++-- utility/netintf.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/utility/net_types.h b/utility/net_types.h index 431f3bea8b..2c77e8e9af 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 @@ -26,7 +26,8 @@ extern "C" { /* gen_headers */ #include "freeciv_config.h" -/* map symbolic Winsock error names to symbolic errno names */ +/* Map symbolic Winsock error names to symbolic errno names. + * Update also set_socket_errno() when changing this. */ #ifdef FREECIV_HAVE_WINSOCK #undef EINTR #undef EINPROGRESS diff --git a/utility/netintf.c b/utility/netintf.c index c3db3942c2..ac4397fa2b 100644 --- a/utility/netintf.c +++ b/utility/netintf.c @@ -77,8 +77,8 @@ static void set_socket_errno(void) { int err = WSAGetLastError(); - switch(err) { - /* these have mappings to symbolic errno names in netintf.h */ + switch (err) { + /* these have mappings to symbolic errno names in net_types.h */ case WSAEINTR: case WSAEWOULDBLOCK: case WSAECONNRESET: -- 2.30.2