| From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> | 
|---|---|
| To: | jeff(at)jeffjohnson(dot)net | 
| Cc: | pgsql-interfaces(at)postgresql(dot)org, pgsql-docs(at)postgresql(dot)org | 
| Subject: | Re: [INTERFACES] libpq sockets on win32 | 
| Date: | 2001-06-04 18:22:45 | 
| Message-ID: | 200106041822.f54IMjY29512@candle.pha.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-docs pgsql-interfaces | 
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(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
| Attachment | Content-Type | Size | 
|---|---|---|
| unknown_filename | text/plain | 585 bytes | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Eisentraut | 2001-06-04 18:24:23 | Re: libpq sockets on win32 | 
| Previous Message | Jeff Johnson | 2001-06-04 18:01:52 | RE: [INTERFACES] libpq sockets on win32 | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Eisentraut | 2001-06-04 18:24:23 | Re: libpq sockets on win32 | 
| Previous Message | Jeff Johnson | 2001-06-04 18:01:52 | RE: [INTERFACES] libpq sockets on win32 |