* fhandler.cc (fhandler_base::open_with_arch): Call close_on_exec last to avoid
setting close_on_exec for archetype. * fhandler_tty.cc (fhandler_pty_master::setup): Protect {from,to}_pty handles. Use consistent naming in debug output. Use inheritable handles and... (fhandler_pty_master::fixup_after_fork): ...avoid duplicating handles here. (fhandler_pty_slave::open): Don't set close_on_exec flag here.
This commit is contained in:
@ -453,7 +453,6 @@ int
|
||||
fhandler_base::open_with_arch (int flags, mode_t mode)
|
||||
{
|
||||
int res;
|
||||
close_on_exec (flags & O_CLOEXEC);
|
||||
if (!(res = (archetype && archetype->io_handle)
|
||||
|| open (flags, (mode & 07777) & ~cygheap->umask)))
|
||||
{
|
||||
@ -480,6 +479,7 @@ fhandler_base::open_with_arch (int flags, mode_t mode)
|
||||
open_setup (flags);
|
||||
}
|
||||
|
||||
close_on_exec (flags & O_CLOEXEC);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user