Skip to content

Commit

Permalink
TMP: Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Nov 9, 2023
1 parent 0e496fe commit 97f1417
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions go/tools/bzltestutil/wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,16 @@ func Wrap(pkg string) error {
// process in a way that also results in the signal handler registered
// below triggering.
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGTERM)
signal.Notify(c)
<-c
if runtime.GOOS == "windows" {
println("received sigterm on Windows")
exec.Command("TASKKILL", "/PID", strconv.Itoa(cmd.Process.Pid)).Run()
term := exec.Command("TASKKILL", "/PID", strconv.Itoa(cmd.Process.Pid))
term.Stdout = os.Stdout
term.Stderr = os.Stderr
err := term.Run()
if err != nil {
log.Printf("error while terminating process: %s", err)
}
} else {
cmd.Process.Signal(syscall.SIGTERM)
}
Expand Down

0 comments on commit 97f1417

Please sign in to comment.