From d3d4aa96aa1150e5ae930b0f8a295762779aa86c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 13 Aug 2009 10:26:42 +0000 Subject: * fhandler.h (class fhandler_socket): Add peer_sun_path member. (fhandler_socket::set_peer_sun_path): New method. (fhandler_socket::get_peer_sun_path): New method. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize peer_sun_path to NULL. (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary. (fhandler_socket::dup): Duplicate peer_sun_path. (fhandler_socket::accept): Ditto. Return fake unbound peer content and len in case of AF_LOCAL sockets. (fhandler_socket::getsockname): Always use local sockaddr_storage to store socket address and copy over to incoming address. Handle every namelen correctly per POSIX. (fhandler_socket::getpeername): Ditto. Add code path to return correct value for AF_LOCAL sockets. (fhandler_socket::set_peer_sun_path): New method. * net.cc (socketpair): Set peer_sun_path to empty string, just like sun_path. --- winsup/cygwin/fhandler.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index f661fc01f..7733d8f50 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -462,6 +462,7 @@ class fhandler_socket: public fhandler_base private: char *sun_path; + char *peer_sun_path; struct status_flags { unsigned async_io : 1; /* async I/O */ @@ -533,6 +534,8 @@ class fhandler_socket: public fhandler_base int get_socket_type () {return type;} void set_sun_path (const char *path); char *get_sun_path () {return sun_path;} + void set_peer_sun_path (const char *path); + char *get_peer_sun_path () {return peer_sun_path;} int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2))); int __stdcall fstatvfs (struct statvfs *buf) __attribute__ ((regparm (2))); -- cgit v1.2.3