Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-07-31 16:37:52 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-07-31 16:37:52 +0400
commitc1146045298c1bbd3c808fc8a4f5244a9dbaa9e4 (patch)
tree106a90b8bd72330c4719f8904c7f5c1a061efbc1 /winsup/cygwin/fhandler_socket.cc
parent6c6fe41781020e84d9fecf3f65505e72db740315 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc23
1 files changed, 3 insertions, 20 deletions
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);