* 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:
Christopher Faylor
2011-07-04 05:08:28 +00:00
parent 867649762b
commit b9a0725042
3 changed files with 18 additions and 12 deletions

View File

@ -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;
}