Cygwin: ctrl_c_handler: Use 64 bit timer

Just don't use GetTickCount for obvious reasons

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2019-03-24 22:13:00 +01:00
parent 4afc52d57c
commit 5737045c00
2 changed files with 4 additions and 4 deletions

View File

@ -1134,7 +1134,7 @@ ctrl_c_handler (DWORD type)
handled *by* the process group leader. */ handled *by* the process group leader. */
if (t && (!have_execed || have_execed_cygwin) if (t && (!have_execed || have_execed_cygwin)
&& t->getpgid () == myself->pid && && t->getpgid () == myself->pid &&
(GetTickCount () - t->last_ctrl_c) >= MIN_CTRL_C_SLOP) (GetTickCount64 () - t->last_ctrl_c) >= MIN_CTRL_C_SLOP)
/* Otherwise we just send a SIGINT to the process group and return TRUE /* Otherwise we just send a SIGINT to the process group and return TRUE
(to indicate that we have handled the signal). At this point, type (to indicate that we have handled the signal). At this point, type
should be a CTRL_C_EVENT or CTRL_BREAK_EVENT. */ should be a CTRL_C_EVENT or CTRL_BREAK_EVENT. */
@ -1144,9 +1144,9 @@ ctrl_c_handler (DWORD type)
if (type == CTRL_BREAK_EVENT if (type == CTRL_BREAK_EVENT
&& t->ti.c_cc[VINTR] == 3 && t->ti.c_cc[VQUIT] == 3) && t->ti.c_cc[VINTR] == 3 && t->ti.c_cc[VQUIT] == 3)
sig = SIGQUIT; sig = SIGQUIT;
t->last_ctrl_c = GetTickCount (); t->last_ctrl_c = GetTickCount64 ();
t->kill_pgrp (sig); t->kill_pgrp (sig);
t->last_ctrl_c = GetTickCount (); t->last_ctrl_c = GetTickCount64 ();
return TRUE; return TRUE;
} }

View File

@ -42,7 +42,7 @@ public:
pid_t pgid; pid_t pgid;
bool output_stopped; /* FIXME: Maybe do this with a mutex someday? */ bool output_stopped; /* FIXME: Maybe do this with a mutex someday? */
fh_devices ntty; fh_devices ntty;
DWORD last_ctrl_c; /* tick count of last ctrl-c */ ULONGLONG last_ctrl_c; /* tick count of last ctrl-c */
bool is_console; bool is_console;
IMPLEMENT_STATUS_FLAG (bool, initialized) IMPLEMENT_STATUS_FLAG (bool, initialized)