summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-03-24 22:13:00 +0100
committerCorinna Vinschen <corinna@vinschen.de>2019-03-24 22:13:00 +0100
commit5737045c00db0cf9462b556bf56fbfa15c9ba90c (patch)
tree583bf22f06fbfb0ad9646ff0507af2e7a456313f
parent4afc52d57cc9355a95728235e7ce3a6664c36df4 (diff)
downloadcygnal-5737045c00db0cf9462b556bf56fbfa15c9ba90c.tar.gz
cygnal-5737045c00db0cf9462b556bf56fbfa15c9ba90c.tar.bz2
cygnal-5737045c00db0cf9462b556bf56fbfa15c9ba90c.zip
Cygwin: ctrl_c_handler: Use 64 bit timer
Just don't use GetTickCount for obvious reasons Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/exceptions.cc6
-rw-r--r--winsup/cygwin/tty.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 491eedbe4..da4348fdb 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -1134,7 +1134,7 @@ ctrl_c_handler (DWORD type)
handled *by* the process group leader. */
if (t && (!have_execed || have_execed_cygwin)
&& 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
(to indicate that we have handled the signal). At this point, type
should be a CTRL_C_EVENT or CTRL_BREAK_EVENT. */
@@ -1144,9 +1144,9 @@ ctrl_c_handler (DWORD type)
if (type == CTRL_BREAK_EVENT
&& t->ti.c_cc[VINTR] == 3 && t->ti.c_cc[VQUIT] == 3)
sig = SIGQUIT;
- t->last_ctrl_c = GetTickCount ();
+ t->last_ctrl_c = GetTickCount64 ();
t->kill_pgrp (sig);
- t->last_ctrl_c = GetTickCount ();
+ t->last_ctrl_c = GetTickCount64 ();
return TRUE;
}
diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h
index 362ae74dc..9aee43b9c 100644
--- a/winsup/cygwin/tty.h
+++ b/winsup/cygwin/tty.h
@@ -42,7 +42,7 @@ public:
pid_t pgid;
bool output_stopped; /* FIXME: Maybe do this with a mutex someday? */
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;
IMPLEMENT_STATUS_FLAG (bool, initialized)