diff options
| author | Tom Lane | 2005-08-25 17:51:01 +0000 |
|---|---|---|
| committer | Tom Lane | 2005-08-25 17:51:01 +0000 |
| commit | 09a6c909458b44c51d0c8a8b58ae2590c7815b9f (patch) | |
| tree | 876e5a59499c577581158bb3e177c4d2467cf9f3 /src/include | |
| parent | 1a33436224146fc1091a7eca2e87fde3c5463767 (diff) | |
Fix bogus freeaddrinfo() call in WIN32 code, extend gai_strerror to
cover more error codes. Per Petr Jelinek.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/getaddrinfo.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h index 8c430bf5d85..3561aac0910 100644 --- a/src/include/getaddrinfo.h +++ b/src/include/getaddrinfo.h @@ -15,7 +15,7 @@ * * Copyright (c) 2003-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.15 2005/07/27 12:44:10 neilc Exp $ + * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.16 2005/08/25 17:50:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -31,6 +31,7 @@ /* Various macros that ought to be in <netdb.h>, but might not be */ #ifndef EAI_FAIL +#ifndef WIN32 #define EAI_BADFLAGS (-1) #define EAI_NONAME (-2) #define EAI_AGAIN (-3) @@ -40,7 +41,18 @@ #define EAI_SERVICE (-8) #define EAI_MEMORY (-10) #define EAI_SYSTEM (-11) -#endif +#else /* WIN32 */ +#define EAI_AGAIN WSATRY_AGAIN +#define EAI_BADFLAGS WSAEINVAL +#define EAI_FAIL WSANO_RECOVERY +#define EAI_FAMILY WSAEAFNOSUPPORT +#define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY +#define EAI_NODATA WSANO_DATA +#define EAI_NONAME WSAHOST_NOT_FOUND +#define EAI_SERVICE WSATYPE_NOT_FOUND +#define EAI_SOCKTYPE WSAESOCKTNOSUPPORT +#endif /* !WIN32 */ +#endif /* !EAI_FAIL */ #ifndef AI_PASSIVE #define AI_PASSIVE 0x0001 |
