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
|
/* Allow to reopen from handle. This is utilized by
|
||||||
open ("/proc/PID/fd/DESCRIPTOR", ...); */
|
open ("/proc/PID/fd/DESCRIPTOR", ...); */
|
||||||
if (get_handle ())
|
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
|
else
|
||||||
pc.get_object_attr (attr, *sec_none_cloexec (flags));
|
pc.get_object_attr (attr, *sec_none_cloexec (flags));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue