* dtable.cc (fh_alloc): Treat pc.dev as unsigned.

* fhandler_console.cc (fhandler_console::set_unit): Use lock always to avoid
races between competing cygwin processes running on the console.
This commit is contained in:
Christopher Faylor
2012-03-10 17:51:33 +00:00
parent ecd676f23c
commit 6c95669d23
3 changed files with 9 additions and 5 deletions

View File

@ -134,6 +134,7 @@ fhandler_console::set_unit ()
{
bool created;
fh_devices devset;
lock_ttys here;
if (shared_console_info)
{
fh_devices this_unit = dev ();
@ -152,10 +153,7 @@ fhandler_console::set_unit ()
shared_console_info = open_shared_console (me, cygheap->console_h, created);
ProtectHandleINH (cygheap->console_h);
if (created)
{
lock_ttys here;
shared_console_info->tty_min_state.setntty (DEV_CONS_MAJOR, console_unit (me));
}
shared_console_info->tty_min_state.setntty (DEV_CONS_MAJOR, console_unit (me));
devset = (fh_devices) shared_console_info->tty_min_state.getntty ();
}