* fhandler_tty.cc (fhandler_pty_master::close): Always close

from_master/to_master since we always have copies of these handles.
This commit is contained in:
Christopher Faylor 2006-06-12 14:56:31 +00:00
parent 184574d61c
commit 313b51e6c1
2 changed files with 11 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2006-06-12 Christopher Faylor <cgf@timesys.com>
* fhandler_tty.cc (fhandler_pty_master::close): Always close
from_master/to_master since we always have copies of these handles.
2006-06-12 Corinna Vinschen <corinna@vinschen.de>
* include/sys/wait.h: Move definition of wait constants from here...

View File

@ -1166,18 +1166,12 @@ fhandler_pty_master::close ()
}
fhandler_tty_master *arch = (fhandler_tty_master *) archetype;
if (arch->dwProcessId != GetCurrentProcessId ())
termios_printf ("not closing from_master(%p)/to_master(%p) since we don't own them(%d)",
arch->from_master, arch->to_master, arch->dwProcessId);
else
{
termios_printf ("closing from_master(%p)/to_master(%p) since we own them(%d)",
arch->from_master, arch->to_master, arch->dwProcessId);
if (!ForceCloseHandle (arch->from_master))
termios_printf ("error closing from_master %p, %E", arch->from_master);
if (!ForceCloseHandle (arch->to_master))
termios_printf ("error closing from_master %p, %E", arch->to_master);
}
termios_printf ("closing from_master(%p)/to_master(%p) since we own them(%d)",
arch->from_master, arch->to_master, arch->dwProcessId);
if (!ForceCloseHandle (arch->from_master))
termios_printf ("error closing from_master %p, %E", arch->from_master);
if (!ForceCloseHandle (arch->to_master))
termios_printf ("error closing from_master %p, %E", arch->to_master);
fhandler_tty_common::close ();
if (hExeced || get_ttyp ()->master_pid != myself->pid)