File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -387,19 +387,23 @@ public class SwiftTool<Options: ToolOptions> {
387
387
// Terminate all processes on receiving an interrupt signal.
388
388
processSet. terminate ( )
389
389
390
+ #if os(Windows)
391
+ // Exit as if by signal()
392
+ TerminateProcess ( GetCurrentProcess ( ) , 3 )
393
+ #elseif os(macOS)
390
394
// Install the default signal handler.
391
395
var action = sigaction ( )
392
- #if os(macOS)
393
396
action. __sigaction_u. __sa_handler = SIG_DFL
397
+ sigaction ( SIGINT, & action, nil )
398
+ kill ( getpid ( ) , SIGINT)
394
399
#else
400
+ var action = sigaction ( )
395
401
action. __sigaction_handler = unsafeBitCast (
396
402
SIG_DFL,
397
403
to: sigaction. __Unnamed_union___sigaction_handler. self)
398
- #endif
399
404
sigaction ( SIGINT, & action, nil )
400
-
401
- // Die with sigint.
402
405
kill ( getpid ( ) , SIGINT)
406
+ #endif
403
407
}
404
408
self . processSet = processSet
405
409
You can’t perform that action at this time.
0 commit comments