Created
February 1, 2014 11:19
-
-
Save ku1ik/8750940 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Process struct { | |
Monitor Monitor | |
} | |
func (p *Process) Kill(sig os.Signal) { | |
pid, err := p.Monitor.Pid() | |
if err != nil { | |
log.Println(err) | |
return | |
} | |
fmt.Printf("forwarding %v to %v\n", sig, pid) | |
process, err := os.FindProcess(pid) | |
if err != nil { | |
log.Println(err) | |
return | |
} | |
err = process.Signal(sig) | |
if err != nil { | |
log.Println("failed to send signal ", sig, " to pid ", pid) | |
log.Println(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment