summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 32454511a..a3553a728 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -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 ();
}