connect patch

Jason Tishler jason@tishler.net
Wed Feb 6 10:10:00 GMT 2002


The attached patch fixes a SEGV when getsockname () is called.  This
problem can be tickled by the PostgreSQL 7.2 version of psql:

    http://archives.postgresql.org/pgsql-cygwin/2002-02/msg00012.php

Note that I essentially plagiarized the following commit:

    http://cygwin.com/ml/cygwin-cvs/2002-q1/msg00028.html

Was this the right thing to do?

Thanks,
Jason
-------------- next part --------------
Index: net.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/net.cc,v
retrieving revision 1.99
diff -u -p -r1.99 net.cc
--- net.cc	2002/01/29 13:39:41	1.99
+++ net.cc	2002/02/06 17:52:16
@@ -557,6 +557,8 @@ cygwin_socket (int af, int type, int pro
 	name = (type == SOCK_STREAM ? "/dev/streamsocket" : "/dev/dgsocket");
 
       fdsock (fd, name, soc)->set_addr_family (af);
+      if (af == AF_LOCAL)
+	fdsock (fd, name, soc)->set_sun_path (name);
       res = fd;
     }
 
-------------- next part --------------
2002-02-06  Jason Tishler  <jason@tishler.net>

	* net.cc (cygwin_socket): Set sun_path for newly connected socket.


More information about the Cygwin-patches mailing list