Cygwin: AF_UNIX: Add fixup_after_exec method

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-03-10 21:09:28 +01:00
parent 1bb3d65182
commit 7b1028974b
2 changed files with 10 additions and 2 deletions

View File

@ -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:

View File

@ -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)
{
@ -996,6 +998,13 @@ fhandler_socket_unix::fixup_after_fork (HANDLE parent)
cwt_param = NULL;
}
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)
{
@ -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 ();