summaryrefslogtreecommitdiffstats
path: root/lldb/tools/driver/Driver.cpp
diff options
context:
space:
mode:
authorNathan Lanza <nathan@lanza.io>2019-07-12 04:43:46 +0000
committerNathan Lanza <nathan@lanza.io>2019-07-12 04:43:46 +0000
commit320d6795b29efee3f5d47e2c88dcd74d621e482f (patch)
tree1a2cdc41a641a1d93af23aa3b3110c5bba049b35 /lldb/tools/driver/Driver.cpp
parent5b9484e559d44bd923fc290e335891b1dd2e17c4 (diff)
downloadbcm5719-llvm-320d6795b29efee3f5d47e2c88dcd74d621e482f.tar.gz
bcm5719-llvm-320d6795b29efee3f5d47e2c88dcd74d621e482f.zip
[windows] re-call signal in sigint_handler for Windows
Summary: Windows requires re-setting the signal handler each time it is used and thus ctrl-c was not behaving properly on Windows Reviewers: jfb Differential Revision: https://reviews.llvm.org/D64046 llvm-svn: 365868
Diffstat (limited to 'lldb/tools/driver/Driver.cpp')
-rw-r--r--lldb/tools/driver/Driver.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index 53fa1b2e89a..043aba7b07b 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -706,6 +706,9 @@ void sigwinch_handler(int signo) {
}
void sigint_handler(int signo) {
+#ifdef _WIN32 // Restore handler as it is not persistent on Windows
+ signal(SIGINT, sigint_handler);
+#endif
static std::atomic_flag g_interrupt_sent = ATOMIC_FLAG_INIT;
if (g_driver != nullptr) {
if (!g_interrupt_sent.test_and_set()) {
OpenPOWER on IntegriCloud