From c1146045298c1bbd3c808fc8a4f5244a9dbaa9e4 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 31 Jul 2011 12:37:52 +0000 Subject: * fhandler.h (class fhandler_dev_mem): Remove dup method declaration. * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Accommodate the fact that the entire fhandler gets copied over to the child in operator =. * fhandler_floppy.cc (fhandler_dev_floppy::dup): Ditto. * fhandler_raw.cc (fhandler_dev_raw::dup): Ditto. * fhandler_serial.cc (fhandler_serial::dup): Ditto. * fhandler_socket.cc (fhandler_socket::dup): Ditto. * fhandler_virtual.cc (fhandler_virtual::dup): Ditto. * fhandler_mem.cc (fhandler_dev_mem::dup): Ditto. Remove entirely. --- winsup/cygwin/fhandler_socket.cc | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'winsup/cygwin/fhandler_socket.cc') diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 500ee5069..bcb720fb2 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -770,28 +770,11 @@ fhandler_socket::dup (fhandler_base *child) NtClose (fhs->wsock_mtx); return -1; } - fhs->wsock_events = wsock_events; - - fhs->rmem (rmem ()); - fhs->wmem (wmem ()); - fhs->addr_family = addr_family; - fhs->set_socket_type (get_socket_type ()); if (get_addr_family () == AF_LOCAL) { fhs->set_sun_path (get_sun_path ()); fhs->set_peer_sun_path (get_peer_sun_path ()); - if (get_socket_type () == SOCK_STREAM) - { - fhs->sec_pid = sec_pid; - fhs->sec_uid = sec_uid; - fhs->sec_gid = sec_gid; - fhs->sec_peer_pid = sec_peer_pid; - fhs->sec_peer_uid = sec_peer_uid; - fhs->sec_peer_gid = sec_peer_gid; - } } - fhs->connect_state (connect_state ()); - if (!need_fixup_before ()) { int ret = fhandler_base::dup (child); @@ -806,14 +789,14 @@ fhandler_socket::dup (fhandler_base *child) cygheap->user.deimpersonate (); fhs->init_fixup_before (); fhs->set_io_handle (get_io_handle ()); - if (!fhs->fixup_before_fork_exec (GetCurrentProcessId ())) + int ret = fhs->fixup_before_fork_exec (GetCurrentProcessId ()); + cygheap->user.reimpersonate (); + if (!ret) { - cygheap->user.reimpersonate (); fhs->fixup_after_fork (GetCurrentProcess ()); if (fhs->get_io_handle() != (HANDLE) INVALID_SOCKET) return 0; } - cygheap->user.reimpersonate (); cygheap->fdtab.dec_need_fixup_before (); NtClose (fhs->wsock_evt); NtClose (fhs->wsock_mtx); -- cgit v1.2.3