From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 2A5FD385740F; Thu, 4 Aug 2022 10:56:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A5FD385740F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: net.cc: create own type host_errmap_t for host_errmap X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 8053ccd44bf3bae3092ca52c4cb5e41f19e813a6 X-Git-Newrev: a8c1dd2ce08039e939dd1c57f02e5f1ed1593398 Message-Id: <20220804105632.2A5FD385740F@sourceware.org> Date: Thu, 4 Aug 2022 10:56:32 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2022 10:56:32 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Da8c1dd2ce08= 039e939dd1c57f02e5f1ed1593398 commit a8c1dd2ce08039e939dd1c57f02e5f1ed1593398 Author: Corinna Vinschen Date: Thu Aug 4 11:37:58 2022 +0200 Cygwin: net.cc: create own type host_errmap_t for host_errmap =20 This decouples host_errmap from the errmap_t definition which is about to be changed in a followup patch. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/net.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 087248439..83ea37f6e 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -205,11 +205,12 @@ __set_winsock_errno (const char *fn, int ln) syscall_printf ("%s:%d - winsock error %u -> errno %d", fn, ln, werr, er= r); } =20 -/* - * Since the member `s' isn't used for debug output we can use it - * for the error text returned by herror and hstrerror. - */ -static const errmap_t host_errmap[] =3D { +static const struct host_errmap_t +{ + DWORD w; /* windows version of error */ + const char *s; /* error text returned by herror and hstrerror */ + int e; /* errno version of error */ +} host_errmap[] =3D { {WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND}, {WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN}, {WSANO_RECOVERY, "Unknown server error", NO_RECOVERY},