* fhandler.h (set_console_state_for_spawn): Drop declaration.

* fhandler_console.cc (set_console_state_for_spawn): Remove.
	(fhandler_console::open): Set console state last.  Don't set
	ENABLE_PROCESSED_INPUT flag.
	* spawn.cc (spawn_guts): Drop call to set_console_state_for_spawn.
This commit is contained in:
Corinna Vinschen 2008-06-12 15:57:23 +00:00
parent a7e0bc7bbe
commit 9cdaf8733f
4 changed files with 14 additions and 39 deletions

View File

@ -1,3 +1,11 @@
2008-06-12 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (set_console_state_for_spawn): Drop declaration.
* fhandler_console.cc (set_console_state_for_spawn): Remove.
(fhandler_console::open): Set console state last. Don't set
ENABLE_PROCESSED_INPUT flag.
* spawn.cc (spawn_guts): Drop call to set_console_state_for_spawn.
2008-06-11 Corinna Vinschen <corinna@vinschen.de>
* path.cc (get_nt_native_path): Drop considerations for DOS devices.

View File

@ -1423,6 +1423,4 @@ class select_stuff
device_specific_serial (0),
device_specific_mailslot (0) {}
};
void __stdcall set_console_state_for_spawn (bool);
#endif /* _FHANDLER_H_ */

View File

@ -121,34 +121,6 @@ tty_list::get_tty (int n)
return &nada;
}
/* Determine if a console is associated with this process prior to a spawn.
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 (bool iscyg)
{
if (fhandler_console::need_invisible () || iscyg
|| (myself->ctty >= 0 && myself->ctty != TTY_CONSOLE))
return;
HANDLE h = CreateFile ("CONIN$", GENERIC_READ, FILE_SHARE_WRITE,
&sec_none_nih, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
if (h == INVALID_HANDLE_VALUE)
return;
if (shared_console_info != NULL)
{
SetConsoleMode (h, ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT);
shared_console_info->tty_min_state.rstcons (true);
}
CloseHandle (h);
return;
}
/* The results of GetConsoleCP() and GetConsoleOutputCP() cannot be
cached, because a program or the user can change these values at
any time. */
@ -647,16 +619,15 @@ fhandler_console::open (int flags, mode_t)
dev_state->set_default_attr ();
}
DWORD cflags;
if (GetConsoleMode (get_io_handle (), &cflags))
{
cflags |= ENABLE_PROCESSED_INPUT;
SetConsoleMode (get_io_handle (), ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | cflags);
}
tc->rstcons (false);
set_open_status ();
cygheap->manage_console_count ("fhandler_console::open", 1);
DWORD cflags;
if (GetConsoleMode (get_io_handle (), &cflags))
SetConsoleMode (get_io_handle (),
ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | cflags);
debug_printf ("opened conin$ %p, conout$ %p", get_io_handle (),
get_output_handle ());

View File

@ -441,8 +441,6 @@ spawn_guts (const char *prog_arg, const char *const *argv,
if (mode == _P_DETACH)
c_flags |= DETACHED_PROCESS;
else
set_console_state_for_spawn (real_path.iscygexec ());
if (mode != _P_OVERLAY)
myself->exec_sendsig = NULL;