Skip to content

Commit 21d9350

Browse files
authored
Merge pull request swiftlang#1157 from artemcm/BetterSIGINThandle
On interrupt, after handling the compilation process set termination, restore the SIGINT default action.
2 parents 73fa69e + b1155b8 commit 21d9350

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/swift-driver/main.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func getExitCode(_ code: Int32) -> Int32 {
3737
#if os(Windows)
3838
TerminateProcess(GetCurrentProcess(), UINT(0xC0000000 | UINT(2)))
3939
#else
40+
signal(SIGINT, SIG_DFL)
4041
kill(getpid(), SIGINT)
4142
#endif
4243
fatalError("Invalid state, could not kill process")

0 commit comments

Comments
 (0)