diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-08-13 10:26:42 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-08-13 10:26:42 +0000 |
commit | d3d4aa96aa1150e5ae930b0f8a295762779aa86c (patch) | |
tree | afd9c835e4c310f3f1cfe495e896f39e07fc59db /winsup/cygwin/net.cc | |
parent | af0a038ecbb7e6eecb18a034a414b871e55b37f5 (diff) | |
download | cygnal-d3d4aa96aa1150e5ae930b0f8a295762779aa86c.tar.gz cygnal-d3d4aa96aa1150e5ae930b0f8a295762779aa86c.tar.bz2 cygnal-d3d4aa96aa1150e5ae930b0f8a295762779aa86c.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r-- | winsup/cygwin/net.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index efc06ad25..80f869a25 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -2867,6 +2867,7 @@ socketpair (int family, int type, int protocol, int *sb) if (sb0 >= 0 && fdsock (sb0, dev, insock)) { ((fhandler_socket *) sb0)->set_sun_path (""); + ((fhandler_socket *) sb0)->set_peer_sun_path (""); ((fhandler_socket *) sb0)->set_addr_family (family); ((fhandler_socket *) sb0)->set_socket_type (type); ((fhandler_socket *) sb0)->connect_state (connected); @@ -2878,6 +2879,7 @@ socketpair (int family, int type, int protocol, int *sb) if (sb1 >= 0 && fdsock (sb1, dev, outsock)) { ((fhandler_socket *) sb1)->set_sun_path (""); + ((fhandler_socket *) sb1)->set_peer_sun_path (""); ((fhandler_socket *) sb1)->set_addr_family (family); ((fhandler_socket *) sb1)->set_socket_type (type); ((fhandler_socket *) sb1)->connect_state (connected); |