mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 00:38:06 +08:00
Cygwin: ctty: Add missing fixup_after_{exec,fork}() call.
Previously, fixup_after_{exec,fork}() calls for CTTY were missing. This patch fixes that. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
This commit is contained in:
parent
5ca1c57a82
commit
523985b31e
@ -913,6 +913,8 @@ dtable::fixup_after_exec ()
|
|||||||
else if (i <= 2)
|
else if (i <= 2)
|
||||||
SetStdHandle (std_consts[i], fh->get_output_handle ());
|
SetStdHandle (std_consts[i], fh->get_output_handle ());
|
||||||
}
|
}
|
||||||
|
if (cygheap->ctty)
|
||||||
|
cygheap->ctty->fixup_after_exec ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -939,6 +941,9 @@ dtable::fixup_after_fork (HANDLE parent)
|
|||||||
else if (i <= 2)
|
else if (i <= 2)
|
||||||
SetStdHandle (std_consts[i], fh->get_output_handle ());
|
SetStdHandle (std_consts[i], fh->get_output_handle ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cygheap->ctty)
|
||||||
|
cygheap->ctty->fixup_after_fork (parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -723,6 +723,7 @@ fhandler_console::set_unit ()
|
|||||||
pc.file_attributes (FILE_ATTRIBUTE_NORMAL);
|
pc.file_attributes (FILE_ATTRIBUTE_NORMAL);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_tc = NULL;
|
||||||
set_handle (NULL);
|
set_handle (NULL);
|
||||||
set_output_handle (NULL);
|
set_output_handle (NULL);
|
||||||
created = false;
|
created = false;
|
||||||
@ -4251,6 +4252,12 @@ fhandler_console::fixup_after_fork_exec (bool execing)
|
|||||||
set_unit ();
|
set_unit ();
|
||||||
setup_io_mutex ();
|
setup_io_mutex ();
|
||||||
wpbuf.init ();
|
wpbuf.init ();
|
||||||
|
if (cygheap->ctty == this && !get_handle () && !get_output_handle ())
|
||||||
|
{
|
||||||
|
close_with_arch ();
|
||||||
|
cygheap->ctty = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!execing)
|
if (!execing)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user