* 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:
parent
e5a32b9a96
commit
bfa768973c
|
@ -1,3 +1,10 @@
|
||||||
|
2004-05-20 Christopher Faylor <cgf@alum.bu.edu>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2004-05-17 Corinna Vinschen <corinna@vinschen.de>
|
2004-05-17 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* grp.cc (getgrgid_r): Replace struct group by struct __group32 in
|
* grp.cc (getgrgid_r): Replace struct group by struct __group32 in
|
||||||
|
|
|
@ -1164,6 +1164,7 @@ fhandler_pty_master::open (int flags, mode_t)
|
||||||
slave = *ttys_dev;
|
slave = *ttys_dev;
|
||||||
slave.setunit (ntty);
|
slave.setunit (ntty);
|
||||||
cygwin_shared->tty[ntty]->common_init (this);
|
cygwin_shared->tty[ntty]->common_init (this);
|
||||||
|
ReleaseMutex (tty_mutex); // lock was set in allocate_tty
|
||||||
inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE);
|
inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE);
|
||||||
set_flags ((flags & ~O_TEXT) | O_BINARY);
|
set_flags ((flags & ~O_TEXT) | O_BINARY);
|
||||||
set_open_status ();
|
set_open_status ();
|
||||||
|
|
|
@ -282,16 +282,22 @@ tty_list::allocate_tty (bool with_console)
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (freetty < 0)
|
if (freetty < 0)
|
||||||
|
{
|
||||||
|
ReleaseMutex (tty_mutex);
|
||||||
system_printf ("No tty allocated");
|
system_printf ("No tty allocated");
|
||||||
|
}
|
||||||
else if (!with_console)
|
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
|
else
|
||||||
{
|
{
|
||||||
termios_printf ("console %p associated with tty%d", console, freetty);
|
termios_printf ("console %p associated with tty%d", console, freetty);
|
||||||
if (!hmaster)
|
if (!hmaster)
|
||||||
create_tty_master (freetty);
|
create_tty_master (freetty);
|
||||||
}
|
|
||||||
ReleaseMutex (tty_mutex);
|
ReleaseMutex (tty_mutex);
|
||||||
|
}
|
||||||
return freetty;
|
return freetty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue