mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 13:55:55 +00:00
8cdbde20bd
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.
20 lines
368 B
Go
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)
|
|
}
|