aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-12-03 00:28:24 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-12-03 00:28:24 +0000
commitae8a9b8a9f6aec5feba31f1a88385f0d2eee379f (patch)
treeeda922dcf4fe11f698e74f14c22ad10a773da365 /src
parentacf7aa6240db3e5d8be3f4d884cafaecc154d568 (diff)
downloadpostgresql-ae8a9b8a9f6aec5feba31f1a88385f0d2eee379f.tar.gz
postgresql-ae8a9b8a9f6aec5feba31f1a88385f0d2eee379f.zip
Remove code to lookup WinSock error strings in netmsg.dll; according to
Magnus Hagander that DLL only contains error strings for the Net*** functions, *not* WinSock. We need to look for a workable solution for older Windows flavors ... but it won't happen for PG 7.2.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-misc.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index 0372da3a8b1..7e166f4a38f 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -25,7 +25,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.64 2001/11/28 19:40:29 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.65 2001/12/03 00:28:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -856,18 +856,17 @@ libpq_gettext(const char *msgid)
/*
* strerror replacement for windows:
*
- * We don't know a fix for win9x yet, but this should work for nt4 and win2k.
- * If you can verify this working on win9x or have a solution, let us know, ok?
+ * This works on WIN2000 and newer, but we don't know where to find WinSock
+ * error strings on older Windows flavors. If you know, clue us in.
*/
const char *
winsock_strerror(int eno)
{
static char err_buf[512];
-#define WSSE_MAXLEN (sizeof(err_buf)-1-13) /* 13 == " (0x00000000)" */
- HINSTANCE netmsgModule;
+#define WSSE_MAXLEN (sizeof(err_buf)-1-13) /* 13 for " (0x00000000)" */
int length;
- /* First try the "system table", this works on Win2k pro */
+ /* First try the "system table", this works on Win2k and up */
if (FormatMessage(
FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
@@ -879,28 +878,7 @@ winsock_strerror(int eno)
NULL))
goto WSSE_GOODEXIT;
- /* That didn't work, let's try the netmsg.dll */
-
- netmsgModule = LoadLibraryEx("netmsg.dll",
- NULL,
- LOAD_LIBRARY_AS_DATAFILE);
-
- if (netmsgModule != NULL)
- {
- if (FormatMessage(
- FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,
- netmsgModule,
- eno,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- err_buf,
- WSSE_MAXLEN,
- NULL))
- {
- FreeLibrary(netmsgModule);
- goto WSSE_GOODEXIT;
- }
- FreeLibrary(netmsgModule);
- }
+ /* Insert other possible lookup methods here ... */
/* Everything failed, just tell the user that we don't know the desc */