Skip to content

Commit

Permalink
[windows] re-call signal in sigint_handler for Windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lanza committed Jul 12, 2019
1 parent 5b9484e commit 320d679
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lldb/tools/driver/Driver.cpp
Expand Up @@ -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()) {
Expand Down

0 comments on commit 320d679

Please sign in to comment.