* tty.cc (tty_list::allocate_tty): Leave tty_mutex armed on successful return

from !with_console
* fhandler_tty.cc (fhandler_pty_master::open): Release tty_mutex here after all
initialization is done.
This commit is contained in:
Christopher Faylor
2004-05-20 17:32:12 +00:00
parent e5a32b9a96
commit bfa768973c
3 changed files with 17 additions and 3 deletions

View File

@@ -282,16 +282,22 @@ tty_list::allocate_tty (bool with_console)
out:
if (freetty < 0)
system_printf ("No tty allocated");
{
ReleaseMutex (tty_mutex);
system_printf ("No tty allocated");
}
else if (!with_console)
termios_printf ("tty%d allocated", freetty);
{
termios_printf ("tty%d allocated", freetty);
/* exit with tty_mutex still held -- caller has more work to do */
}
else
{
termios_printf ("console %p associated with tty%d", console, freetty);
if (!hmaster)
create_tty_master (freetty);
ReleaseMutex (tty_mutex);
}
ReleaseMutex (tty_mutex);
return freetty;
}