mirror of
https://github.com/openziti/zrok.git
synced 2025-01-22 05:48:46 +01:00
back out the SIGINT attempt (#748)
This commit is contained in:
parent
9cf5787c47
commit
123a4ef57b
@ -5,7 +5,6 @@ package proctree
|
||||
import (
|
||||
"os/exec"
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func Init(_ string) error {
|
||||
@ -53,7 +52,7 @@ func WaitChild(c *Child) error {
|
||||
}
|
||||
|
||||
func StopChild(c *Child) error {
|
||||
if err := syscall.Kill(c.cmd.Process.Pid, syscall.SIGINT); err != nil {
|
||||
if err := c.cmd.Process.Kill(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
@ -71,23 +71,7 @@ func WaitChild(c *Child) error {
|
||||
}
|
||||
|
||||
func StopChild(c *Child) error {
|
||||
if err := sendSigInt(c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func sendSigInt(c *Child) error {
|
||||
dll, err := syscall.LoadDLL("kernel32.dll")
|
||||
if er != nil {
|
||||
return err
|
||||
}
|
||||
proc, err := dll.FindProc("GenerateConsoleCtrlEvent")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r, _, err := proc.Call(syscall.CTRL_BREAK_EVENT, uintptr(c.cmd.Process.Pid))
|
||||
if err != nil {
|
||||
if err := c.cmd.Process.Kill(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user