https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a8c1dd2ce08039e939dd1c57f02e5f1ed1593398

commit a8c1dd2ce08039e939dd1c57f02e5f1ed1593398
Author: Corinna Vinschen <[email protected]>
Date:   Thu Aug 4 11:37:58 2022 +0200

    Cygwin: net.cc: create own type host_errmap_t for host_errmap
    
    This decouples host_errmap from the errmap_t definition which is
    about to be changed in a followup patch.
    
    Signed-off-by: Corinna Vinschen <[email protected]>

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, err);
 }
 
-/*
- * 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[] = {
+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[] = {
   {WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND},
   {WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN},
   {WSANO_RECOVERY, "Unknown server error", NO_RECOVERY},

Reply via email to