Re: WSAStartup() in libpq - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: WSAStartup() in libpq
Date
Msg-id 20070308152846.GB8575@svr2.hagander.net
Whole thread Raw
In response to Re: WSAStartup() in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WSAStartup() in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Mar 08, 2007 at 10:10:28AM -0500, Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
> > So I suggest the following simple patch.. Any objections?
>
> One wonders if we need DllMain() at all any more.  We certainly don't
> need that switch statement ...

Indeed. Looking even more into it (sheesh, I really didn't do my
homework here), libpqdll.c isn't even *compiled* on mingw. Or on the new
MSVC build. It's only compiled on the old msvc build. Given that, we can
probably just delete the file.


> Also, isn't the WSACleanup() in freePGconn in the wrong place?  Seems
> like it shouldn't be done until after we've closed the socket.  I'd
> be inclined to put it at the bottom of the routine.

Certainly looks wrong. It's interesting how this could have worked
*before*. That's a clear indication that it really doesn't appear to
matter much what we do here :S

The patch would then look something like this, and a remove of
libpqdll.c.

//Magnus


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WSAStartup() in libpq
Next
From: Tom Lane
Date:
Subject: Re: WSAStartup() in libpq