mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-20 07:51:35 +08:00
* cygheap.cc (init_cygheap::manage_console_count): Turn console control handler
on/off depending on whether we have allocated a console or not. * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry statuses. (dll_crt0_0): Turn on/off console control depending on whether we have a controlling tty or not. * exceptions.cc (init_console_handler): Change BOOL to bool. * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic change. * winsup.h (init_console_handler): Reflect argument type change. * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate capability throughout. * wincap.cc: Ditto.
This commit is contained in:
parent
490cfb83e9
commit
974f27a51a
@ -1,3 +1,20 @@
|
||||
2006-03-15 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* cygheap.cc (init_cygheap::manage_console_count): Turn console control
|
||||
handler on/off depending on whether we have allocated a console or not.
|
||||
* dcrt0.cc (child_info_fork::fork_retry): Add more potential retry
|
||||
statuses.
|
||||
(dll_crt0_0): Turn on/off console control depending on whether we have
|
||||
a controlling tty or not.
|
||||
* exceptions.cc (init_console_handler): Change BOOL to bool.
|
||||
* fhandler_console.cc (fhandler_console::need_invisible): Cosmetic
|
||||
change.
|
||||
* winsup.h (init_console_handler): Reflect argument type change.
|
||||
|
||||
* wincap.h (supports_setconsolectrlhandler_null): Remove duplicate
|
||||
capability throughout.
|
||||
* wincap.cc: Ditto.
|
||||
|
||||
2006-03-14 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* child_info.h (child_info_fork::fork_retry): Declare new function.
|
||||
|
@ -93,13 +93,16 @@ cygheap_fixup_in_child (bool execed)
|
||||
int
|
||||
init_cygheap::manage_console_count (const char *something, int amount, bool avoid_freeing_console)
|
||||
{
|
||||
if (console_count == 0 && amount > 0)
|
||||
init_console_handler (true);
|
||||
console_count += amount;
|
||||
debug_printf ("%s: console_count %d, amount %d, %s, avoid_freeing_console %d",
|
||||
something, console_count, amount, myctty (), avoid_freeing_console);
|
||||
if (!avoid_freeing_console && amount <= 0 && !console_count && myself->ctty == -1)
|
||||
{
|
||||
FreeConsole ();
|
||||
debug_printf ("freed console");
|
||||
BOOL res = FreeConsole ();
|
||||
debug_printf ("freed console, res %d", res);
|
||||
init_console_handler (false);
|
||||
}
|
||||
return console_count;
|
||||
}
|
||||
|
@ -651,9 +651,8 @@ child_info_fork::fork_retry (HANDLE h)
|
||||
switch (exit_code)
|
||||
{
|
||||
case STATUS_CONTROL_C_EXIT:
|
||||
if (retry-- > 0)
|
||||
return 0;
|
||||
break;
|
||||
case STATUS_DLL_INIT_FAILED:
|
||||
case STATUS_DLL_INIT_FAILED_LOGOFF:
|
||||
case EXITCODE_RETRY:
|
||||
if (retry-- > 0)
|
||||
return 0;
|
||||
@ -709,7 +708,6 @@ dll_crt0_0 ()
|
||||
sigproc_init ();
|
||||
|
||||
lock_process::init ();
|
||||
init_console_handler (TRUE);
|
||||
_impure_ptr = _GLOBAL_REENT;
|
||||
_impure_ptr->_stdin = &_impure_ptr->__sf[0];
|
||||
_impure_ptr->_stdout = &_impure_ptr->__sf[1];
|
||||
@ -736,7 +734,10 @@ dll_crt0_0 ()
|
||||
|
||||
child_proc_info = get_cygwin_startup_info ();
|
||||
if (!child_proc_info)
|
||||
memory_init ();
|
||||
{
|
||||
memory_init ();
|
||||
init_console_handler (myself->ctty >= 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
cygwin_user_h = child_proc_info->user_h;
|
||||
@ -772,6 +773,7 @@ dll_crt0_0 ()
|
||||
}
|
||||
break;
|
||||
}
|
||||
init_console_handler (myself->ctty >= 0);
|
||||
}
|
||||
|
||||
user_data->resourcelocks->Init ();
|
||||
@ -782,6 +784,7 @@ dll_crt0_0 ()
|
||||
pinfo_init (envp, envc);
|
||||
uinfo_init (); /* initialize user info */
|
||||
}
|
||||
|
||||
_cygtls::init ();
|
||||
|
||||
/* Initialize events */
|
||||
|
@ -100,7 +100,7 @@ dummy_ctrl_c_handler (DWORD dwCtrlType)
|
||||
}
|
||||
|
||||
void
|
||||
init_console_handler (BOOL install_handler)
|
||||
init_console_handler (bool install_handler)
|
||||
{
|
||||
BOOL res;
|
||||
while (SetConsoleCtrlHandler (ctrl_c_handler, FALSE))
|
||||
|
@ -1885,9 +1885,7 @@ fhandler_console::need_invisible ()
|
||||
failed */
|
||||
debug_printf ("h %p, horig %p, flags %p", h, horig, oi.dwFlags);
|
||||
if (horig && h && h != horig && SetProcessWindowStation (horig))
|
||||
{
|
||||
CloseWindowStation (h);
|
||||
}
|
||||
CloseWindowStation (h);
|
||||
termios_printf ("%d = AllocConsole (), %E", b);
|
||||
invisible_console = true;
|
||||
}
|
||||
|
@ -66,7 +66,6 @@ static NO_COPY wincaps wincap_unknown = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:false
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_95 = {
|
||||
@ -124,7 +123,6 @@ static NO_COPY wincaps wincap_95 = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:false
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_95osr2 = {
|
||||
@ -182,7 +180,6 @@ static NO_COPY wincaps wincap_95osr2 = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:false
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_98 = {
|
||||
@ -240,7 +237,6 @@ static NO_COPY wincaps wincap_98 = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:false
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_98se = {
|
||||
@ -298,7 +294,6 @@ static NO_COPY wincaps wincap_98se = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:false
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_me = {
|
||||
@ -356,7 +351,6 @@ static NO_COPY wincaps wincap_me = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:false
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_nt3 = {
|
||||
@ -414,7 +408,6 @@ static NO_COPY wincaps wincap_nt3 = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:true
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_nt4 = {
|
||||
@ -472,7 +465,6 @@ static NO_COPY wincaps wincap_nt4 = {
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:false,
|
||||
supports_setconsolectrlhandler_null:true
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_nt4sp4 = {
|
||||
@ -529,8 +521,7 @@ static NO_COPY wincaps wincap_nt4sp4 = {
|
||||
has_working_virtual_lock:true,
|
||||
has_disabled_user_tos_setting:false,
|
||||
has_fileid_dirinfo:false,
|
||||
has_exclusiveaddruse:true,
|
||||
supports_setconsolectrlhandler_null:true
|
||||
has_exclusiveaddruse:true
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_2000 = {
|
||||
@ -587,8 +578,7 @@ static NO_COPY wincaps wincap_2000 = {
|
||||
has_working_virtual_lock:true,
|
||||
has_disabled_user_tos_setting:true,
|
||||
has_fileid_dirinfo:true,
|
||||
has_exclusiveaddruse:true,
|
||||
supports_setconsolectrlhandler_null:true
|
||||
has_exclusiveaddruse:true
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_xp = {
|
||||
@ -645,8 +635,7 @@ static NO_COPY wincaps wincap_xp = {
|
||||
has_working_virtual_lock:true,
|
||||
has_disabled_user_tos_setting:true,
|
||||
has_fileid_dirinfo:true,
|
||||
has_exclusiveaddruse:true,
|
||||
supports_setconsolectrlhandler_null:true
|
||||
has_exclusiveaddruse:true
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_2003 = {
|
||||
@ -703,8 +692,7 @@ static NO_COPY wincaps wincap_2003 = {
|
||||
has_working_virtual_lock:true,
|
||||
has_disabled_user_tos_setting:true,
|
||||
has_fileid_dirinfo:true,
|
||||
has_exclusiveaddruse:true,
|
||||
supports_setconsolectrlhandler_null:true
|
||||
has_exclusiveaddruse:true
|
||||
};
|
||||
|
||||
static NO_COPY wincaps wincap_vista = {
|
||||
@ -761,8 +749,7 @@ static NO_COPY wincaps wincap_vista = {
|
||||
has_working_virtual_lock:true,
|
||||
has_disabled_user_tos_setting:true,
|
||||
has_fileid_dirinfo:true,
|
||||
has_exclusiveaddruse:true,
|
||||
supports_setconsolectrlhandler_null:true
|
||||
has_exclusiveaddruse:true
|
||||
};
|
||||
|
||||
wincapc wincap __attribute__((section (".cygwin_dll_common"), shared));
|
||||
|
@ -67,7 +67,6 @@ struct wincaps
|
||||
unsigned has_disabled_user_tos_setting : 1;
|
||||
unsigned has_fileid_dirinfo : 1;
|
||||
unsigned has_exclusiveaddruse : 1;
|
||||
unsigned supports_setconsolectrlhandler_null : 1;
|
||||
};
|
||||
|
||||
class wincapc
|
||||
@ -141,7 +140,6 @@ public:
|
||||
bool IMPLEMENT (has_disabled_user_tos_setting)
|
||||
bool IMPLEMENT (has_fileid_dirinfo)
|
||||
bool IMPLEMENT (has_exclusiveaddruse)
|
||||
bool IMPLEMENT (supports_setconsolectrlhandler_null)
|
||||
|
||||
#undef IMPLEMENT
|
||||
};
|
||||
|
@ -255,7 +255,7 @@ void __stdcall timeval_to_filetime (const struct timeval *, FILETIME *);
|
||||
|
||||
/* Console related */
|
||||
void __stdcall set_console_title (char *);
|
||||
void init_console_handler (BOOL);
|
||||
void init_console_handler (bool);
|
||||
|
||||
void init_global_security ();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user