diff options
author | Christopher Faylor <me@cgf.cx> | 2006-01-12 05:03:15 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-01-12 05:03:15 +0000 |
commit | 750874d33de8778a469cc8c19ad6e4a509078f9b (patch) | |
tree | 0729d73845429ec8e5443e4c13b7e8d55872c43a /winsup | |
parent | 9156ef91209f14c35e8f43e3214e71edfcd1ac01 (diff) | |
download | cygnal-750874d33de8778a469cc8c19ad6e4a509078f9b.tar.gz cygnal-750874d33de8778a469cc8c19ad6e4a509078f9b.tar.bz2 cygnal-750874d33de8778a469cc8c19ad6e4a509078f9b.zip |
* fhandler.h (set_console_state_for_spawn): Whackamole the argument back to a
bool.
* spawn.cc (spawn_guts): Ditto, i.e., once again call
set_console_state_for_spawn with an indication of whether we're about to start
a cygwin process.
* fhandler_console.cc (set_console_state_for_spawn): Don't set the console
state if we know we're starting a cygwin process or if we're using a "real"
tty.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 11 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 2 |
4 files changed, 16 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8cbd84b30..18486f8c4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2006-01-12 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (set_console_state_for_spawn): Whackamole the argument + back to a bool. + * spawn.cc (spawn_guts): Ditto, i.e., once again call + set_console_state_for_spawn with an indication of whether we're about + to start a cygwin process. + * fhandler_console.cc (set_console_state_for_spawn): Don't set the + console state if we know we're starting a cygwin process or if we're + using a "real" tty. + 2006-01-10 Corinna Vinschen <corinna@vinschen.de> * dcrt0.cc (dll_crt0_0): Remove call to wincap.init. diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index a7c759bf1..368e62e8d 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1365,6 +1365,5 @@ class select_stuff device_specific_mailslot (0) {} }; -void __stdcall set_console_state_for_spawn (); - +void __stdcall set_console_state_for_spawn (bool); #endif /* _FHANDLER_H_ */ diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 2cf0219f2..5ca26d2f3 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -144,9 +144,10 @@ tty_list::get_tty (int n) If it is, then just return. If the console has been initialized, then set it into a more friendly state for non-cygwin apps. */ void __stdcall -set_console_state_for_spawn () +set_console_state_for_spawn (bool iscyg) { - if (fhandler_console::need_invisible ()) + if (fhandler_console::need_invisible () || iscyg + || (myself->ctty > 0 && myself->ctty != TTY_CONSOLE)) return; HANDLE h = CreateFile ("CONIN$", GENERIC_READ, FILE_SHARE_WRITE, diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 8be114807..5b36658f8 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -618,7 +618,7 @@ spawn_guts (const char * prog_arg, const char *const *argv, else system_printf ("duplicate to pid_handle failed, %E"); if (mode != _P_DETACH) - set_console_state_for_spawn (); + set_console_state_for_spawn (real_path.iscygexec ()); } /* Some file types (currently only sockets) need extra effort in the parent |