Skip to content

Commit 1d4504d

Browse files
committed
Disable Ctrl-C handling in launcher when starting subprocess.
Fixes jruby/jruby#4519.
1 parent f19c54d commit 1d4504d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jvmlauncher.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ bool JvmLauncher::startOutProcJvm(const char *mainClassName, std::list<std::stri
410410
return false;
411411
}
412412

413+
// disable Ctrl-C handling in the parent process
414+
if (!SetConsoleCtrlHandler(NULL, TRUE)) {
415+
logErr(true, true, "Failed to disable Ctrl-C handling; Ctrl-C may behave oddly: %d", GetLastError());
416+
}
417+
413418
disableFolderVirtualization(pi.hProcess);
414419
ResumeThread(pi.hThread);
415420
WaitForSingleObject(pi.hProcess, INFINITE);

0 commit comments

Comments
 (0)