Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f54IMoE57482; Mon, 4 Jun 2001 14:22:50 -0400 (EDT) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.10.1/8.10.1) id f54IMjY29512; Mon, 4 Jun 2001 14:22:45 -0400 (EDT) From: Bruce Momjian Message-Id: <200106041822.f54IMjY29512@candle.pha.pa.us> Subject: Re: [INTERFACES] libpq sockets on win32 In-Reply-To: "from Jeff Johnson at Jun 4, 2001 02:01:52 pm" To: jeff@jeffjohnson.net Date: Mon, 4 Jun 2001 14:22:45 -0400 (EDT) CC: pgsql-interfaces@postgresql.org, pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=ELM991678965-25950-0_ Content-Transfer-Encoding: 7bit X-Archive-Number: 200106/3 X-Sequence-Number: 798 --ELM991678965-25950-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Can you try this patch and let me know if it helps? It is a different approach. This was the only place I saw errno checked for a non-predefined value. One other solution may be to use the #define only in the libpq C files that need it. What really stinks is that the errno define is only useful for socket errno settings. I do see a use in fe-connect.c: #ifndef WIN32 if (errno == EINPROGRESS || errno == 0) #else if (WSAGetLastError() == WSAEINPROGRESS) #endif I hate to litter this through the whole source. I wonder if we have to bracket the errno checkes with #define/#undef. Can you try that with the fix described on the web page. The above would convert to: #ifdef WIN32 #define errno WSAGetLastError #endif if (errno == EINPROGRESS || errno == 0) #ifdef WIN32 #undef errno #endif Maybe make these into their own macros somehow. > > > This article describes the problem and work around. > > > http://msdn.microsoft.com/library/psdk/winsock/ovrvw3_26ia.htm > > > > I can't read that web site under Netscape. > > > > If I could read it, I think I could fix it. Please send it in some > > readable format. > > > > I chopped the content out and stuck it into a basic HTML file and > attached it. > > Thanks for taking a look, > Jeff [ Attachment, skipping... ] -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 --ELM991678965-25950-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain Content-Disposition: inline; filename="/bjm/diff" Index: src/interfaces/libpq/fe-misc.c =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v retrieving revision 1.49 diff -c -r1.49 fe-misc.c *** src/interfaces/libpq/fe-misc.c 2001/05/28 15:29:51 1.49 --- src/interfaces/libpq/fe-misc.c 2001/06/04 17:52:40 *************** *** 614,619 **** --- 614,623 ---- int sent; + #ifdef WIN32 + errno = 0; /* Win32 doesn't set this, needs reset */ + #endif + #ifdef USE_SSL if (conn->ssl) sent = SSL_write(conn->ssl, ptr, len); --ELM991678965-25950-0_--