diff options
author | Christopher Faylor <me@cgf.cx> | 2012-04-13 02:30:51 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-04-13 02:30:51 +0000 |
commit | 3bfa9d984ba833fc4e439c2c3b706213880a8b37 (patch) | |
tree | ee1c8696de6e151b6eb54c6611afeb354dccc81f /winsup/cygwin/fhandler_console.cc | |
parent | 416b2d8719a91411f65e5d85cef9a74ea4045e79 (diff) | |
download | cygnal-3bfa9d984ba833fc4e439c2c3b706213880a8b37.tar.gz cygnal-3bfa9d984ba833fc4e439c2c3b706213880a8b37.tar.bz2 cygnal-3bfa9d984ba833fc4e439c2c3b706213880a8b37.zip |
* devices.in (exists_console): Allow /dev/con{sole,in,out} to be referenced
they exist.
* devices.cc: Regenerate.
* fhandler_console.cc (fhandler_console::set_unit): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 7478eae19..d2e993fb0 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -136,18 +136,19 @@ fhandler_console::set_unit () fh_devices devset; lock_ttys here; HWND me; + fh_devices this_unit = dev (); + bool generic_console = this_unit == FH_CONIN || this_unit == FH_CONOUT; if (shared_console_info) { - fh_devices this_unit = dev (); fh_devices shared_unit = (fh_devices) shared_console_info->tty_min_state.getntty (); devset = (shared_unit == this_unit || this_unit == FH_CONSOLE - || this_unit == FH_CONIN || this_unit == FH_CONOUT + || generic_console || this_unit == FH_TTY) ? shared_unit : FH_ERROR; created = false; } - else if ((myself->ctty != -1 && !iscons_dev (myself->ctty)) + else if ((!generic_console && (myself->ctty != -1 && !iscons_dev (myself->ctty))) || !(me = GetConsoleWindow ())) devset = FH_ERROR; else |