diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-01-23 17:05:29 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-01-23 17:05:29 +0000 |
commit | f28f68cc4f21f6d50f560cf50c520f62cc7abe7d (patch) | |
tree | 6957913b2bad555ea8a2eacf67cbb04927680be9 /winsup | |
parent | f7fee067b6fddc33fcefb24665daff46b2b18608 (diff) | |
download | cygnal-f28f68cc4f21f6d50f560cf50c520f62cc7abe7d.tar.gz cygnal-f28f68cc4f21f6d50f560cf50c520f62cc7abe7d.tar.bz2 cygnal-f28f68cc4f21f6d50f560cf50c520f62cc7abe7d.zip |
* net.cc (gai_errmap): Add EAI_OVERFLOW entry. Fix formatting.
(cygwin_gai_strerror): Drop using EAI_MAX.
(w32_to_gai_err): Ditto.
* include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/include/netdb.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/net.cc | 31 |
3 files changed, 24 insertions, 17 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d590993b3..6bc74c4fd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2007-01-23 Corinna Vinschen <corinna@vinschen.de> + * net.cc (gai_errmap): Add EAI_OVERFLOW entry. Fix formatting. + (cygwin_gai_strerror): Drop using EAI_MAX. + (w32_to_gai_err): Ditto. + * include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX. + +2007-01-23 Corinna Vinschen <corinna@vinschen.de> + * include/netdb.h: Add AI_xxx flags available since Vista. 2007-01-23 Corinna Vinschen <corinna@vinschen.de> diff --git a/winsup/cygwin/include/netdb.h b/winsup/cygwin/include/netdb.h index c9b46d3e7..59c328602 100644 --- a/winsup/cygwin/include/netdb.h +++ b/winsup/cygwin/include/netdb.h @@ -174,8 +174,7 @@ extern __declspec(dllimport) int h_errno; #define EAI_SYSTEM 11 #define EAI_BADHINTS 12 #define EAI_PROTOCOL 13 - -#define EAI_MAX 14 +#define EAI_OVERFLOW 14 #ifndef __INSIDE_CYGWIN_NET__ void endhostent (void); diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 9e5e135a8..338b504f9 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -3751,26 +3751,27 @@ struct gai_errmap_t static gai_errmap_t gai_errmap[] = { - {0, "Success"}, - {0, "Address family for hostname not supported"}, - {WSATRY_AGAIN, "Temporary failure in name resolution"}, - {WSAEINVAL, "Invalid value for ai_flags"}, - {WSANO_RECOVERY, "Non-recoverable failure in name resolution"}, - {WSAEAFNOSUPPORT, "ai_family not supported"}, + {0, "Success"}, + {0, "Address family for hostname not supported"}, + {WSATRY_AGAIN, "Temporary failure in name resolution"}, + {WSAEINVAL, "Invalid value for ai_flags"}, + {WSANO_RECOVERY, "Non-recoverable failure in name resolution"}, + {WSAEAFNOSUPPORT, "ai_family not supported"}, {WSA_NOT_ENOUGH_MEMORY, "Memory allocation failure"}, - {WSANO_DATA, "No address associated with hostname"}, - {WSAHOST_NOT_FOUND, "hostname nor servname provided, or not known"}, - {WSATYPE_NOT_FOUND, "servname not supported for ai_socktype"}, - {WSAESOCKTNOSUPPORT, "ai_socktype not supported"}, - {0, "System error returned in errno"}, - {0, "Invalid value for hints"}, - {0, "Resolved protocol is unknown"} + {WSANO_DATA, "No address associated with hostname"}, + {WSAHOST_NOT_FOUND, "hostname nor servname provided, or not known"}, + {WSATYPE_NOT_FOUND, "servname not supported for ai_socktype"}, + {WSAESOCKTNOSUPPORT, "ai_socktype not supported"}, + {0, "System error returned in errno"}, + {0, "Invalid value for hints"}, + {0, "Resolved protocol is unknown"}, + {WSAEFAULT, "An argument buffer overflowed"} }; extern "C" const char * cygwin_gai_strerror (int err) { - if (err >= 0 && err < EAI_MAX) + if (err >= 0 && err < (int) (sizeof gai_errmap / sizeof *gai_errmap)) return gai_errmap[err].errtxt; return "Unknown error"; } @@ -3779,7 +3780,7 @@ static int w32_to_gai_err (int w32_err) { if (w32_err >= WSABASEERR) - for (int i = 0; i < EAI_MAX; ++i) + for (unsigned i = 0; i < sizeof gai_errmap / sizeof *gai_errmap; ++i) if (gai_errmap[i].w32_errval == w32_err) return i; return w32_err; |