mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 12:59:21 +08:00
Cygwin: open: handle O_CLOEXEC when opening file from handle
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
9ba65ab8b5
commit
0c545f3264
@ -555,7 +555,11 @@ fhandler_base::open (int flags, mode_t mode)
|
||||
/* Allow to reopen from handle. This is utilized by
|
||||
open ("/proc/PID/fd/DESCRIPTOR", ...); */
|
||||
if (get_handle ())
|
||||
pc.init_reopen_attr (attr, get_handle ());
|
||||
{
|
||||
pc.init_reopen_attr (attr, get_handle ());
|
||||
if (!(flags & O_CLOEXEC))
|
||||
attr.Attributes |= OBJ_INHERIT;
|
||||
}
|
||||
else
|
||||
pc.get_object_attr (attr, *sec_none_cloexec (flags));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user