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 <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-08-04 11:37:58 +02:00
parent 8053ccd44b
commit a8c1dd2ce0
1 changed files with 6 additions and 5 deletions

View File

@ -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); syscall_printf ("%s:%d - winsock error %u -> errno %d", fn, ln, werr, err);
} }
/* static const struct host_errmap_t
* Since the member `s' isn't used for debug output we can use it {
* for the error text returned by herror and hstrerror. DWORD w; /* windows version of error */
*/ const char *s; /* error text returned by herror and hstrerror */
static const errmap_t host_errmap[] = { int e; /* errno version of error */
} host_errmap[] = {
{WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND}, {WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND},
{WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN}, {WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN},
{WSANO_RECOVERY, "Unknown server error", NO_RECOVERY}, {WSANO_RECOVERY, "Unknown server error", NO_RECOVERY},