connect patch

Jason Tishler
Thu Feb 7 07:04:00 GMT 2002


On Thu, Feb 07, 2002 at 02:56:25PM +0100, Corinna Vinschen wrote:
> On Wed, Feb 06, 2002 at 01:07:28PM -0500, Jason Tishler wrote:
> > Was this the right thing to do?
> The patch isn't correct since it now calls fdsock() twice which allocates
> a new fhandler even if the line before already had created one.
> Better:
>   fhandler_socket* res_fh = fdsock (fd, name, soc)->set_addr_family (af);
>   if (af == AF_LOCAL)
>     res_fh->set_sun_path (name);

Oops, I thought that the second call would only return a pointer to the
previously created fhandler.

> However, I don't understand the need for that patch.  Does postgresql
> call getsockname() before calling bind()?

I don't know, but I guess that it does.

> So, IMO, the correct way is to clean up cygwin_getsockname()
> so that it always returns "something" instead of SEGVing.
> Could you please test the below patch if that works with postgresql?

The above works great!


More information about the Cygwin-patches mailing list