consul/command/util_windows.go
Emil Hessman 8cdbde20bd command: fix Windows build
Add a per GOOS implementation to send signals to PIDs
since syscall.Kill does not exist on Windows.

It will always send a SIGKILL on Windows since there
seems to be no POSIX compatible notion.

Fixes build on Windows.
2015-01-25 05:00:52 +01:00

20 lines
368 B
Go

// +build windows
package command
import (
"os"
"syscall"
)
// signalPid sends a sig signal to the process with process id pid.
// Interrupts et al is not implemented on Windows. Always send a SIGKILL.
func signalPid(pid int, sig syscall.Signal) error {
p, err := os.FindProcess(pid)
if err != nil {
return err
}
_ = sig
return p.Signal(syscall.SIGKILL)
}