Skip to content

Commit e29c65d

Browse files
kkebocompnerd
authored andcommitted
Fix Windows build of #4224
1 parent cbac820 commit e29c65d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/Commands/SwiftTool.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,11 @@ extension SwiftCommand {
290290

291291
/// A safe wrapper of TSCBasic.exec.
292292
func exec(path: String, args: [String]) throws -> Never {
293-
// SwiftTool can't handle signals anymore, so reset the signal handler to SIG_DFL before call TSCBasic.exec()
293+
#if !os(Windows)
294+
// On platforms other than Windows, signal(SIGINT, SIG_IGN) is used for handling SIGINT by DispatchSourceSignal,
295+
// but this process is about to be replaced by exec, so SIG_IGN must be returned to default.
294296
signal(SIGINT, SIG_DFL)
297+
#endif
295298

296299
try TSCBasic.exec(path: path, args: args)
297300
}

0 commit comments

Comments
 (0)