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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2018-03-10 23:09:28 +0300
committerCorinna Vinschen <corinna@vinschen.de>2018-03-10 23:09:28 +0300
commit7b1028974b529b22a20566c4fdf50440abefe725 (patch)
tree7ecea7da03e9265ac6b7374108c4be82fba690f8 /winsup
parent1bb3d6518222fad8e8a40d9af431459b47d03554 (diff)
Cygwin: AF_UNIX: Add fixup_after_exec method
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/fhandler.h1
-rw-r--r--winsup/cygwin/fhandler_socket_unix.cc11
2 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 5ceedd9ff..2a3b3662d 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -900,6 +900,7 @@ class fhandler_socket_unix : public fhandler_socket
: set_peer_sun_path (NULL, 0); }
void set_cred ();
void fixup_after_fork (HANDLE parent);
+ void fixup_after_exec ();
void set_close_on_exec (bool val);
public:
diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index 9ac9b2452..6e7d6f147 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -982,6 +982,8 @@ fhandler_socket_unix::set_cred ()
peer_cred.gid = (gid_t) -1;
}
+/* ========================== public methods ========================= */
+
void
fhandler_socket_unix::fixup_after_fork (HANDLE parent)
{
@@ -997,6 +999,13 @@ fhandler_socket_unix::fixup_after_fork (HANDLE parent)
}
void
+fhandler_socket_unix::fixup_after_exec ()
+{
+ if (!close_on_exec ())
+ fixup_after_fork (NULL);
+}
+
+void
fhandler_socket_unix::set_close_on_exec (bool val)
{
fhandler_base::set_close_on_exec (val);
@@ -1004,8 +1013,6 @@ fhandler_socket_unix::set_close_on_exec (bool val)
set_no_inheritance (backing_file_handle, val);
}
-/* ========================== public methods ========================= */
-
fhandler_socket_unix::fhandler_socket_unix ()
{
set_cred ();