Skip to content

Commit 24abc25

Browse files
authored
Merge pull request #1120 from tomerd/radar/95862616
fix SIGINT handler in swift-frontend
2 parents b0ca843 + 9e52192 commit 24abc25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/swift-driver/main.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ func getExitCode(_ code: Int32) -> Int32 {
4545
}
4646

4747
do {
48-
48+
#if !os(Windows)
49+
signal(SIGINT, SIG_IGN)
50+
#endif
4951
let processSet = ProcessSet()
5052
interruptSignalSource.setEventHandler {
5153
// Terminate running compiler jobs and let the driver exit gracefully, remembering
5254
// to return a corresponding exit code when done.
5355
processSet.terminate()
5456
driverInterrupted = true
5557
}
58+
interruptSignalSource.resume()
5659

5760
if ProcessEnv.vars["SWIFT_ENABLE_EXPLICIT_MODULE"] != nil {
5861
CommandLine.arguments.append("-explicit-module-build")

0 commit comments

Comments
 (0)