Replace process.Signal with syscall.Kill
This commit is contained in:
parent
8a28fc42f2
commit
308d079c68
@ -85,13 +85,7 @@ func main() {
|
|||||||
exitCode := 0
|
exitCode := 0
|
||||||
if len(args.PIDs) > 0 {
|
if len(args.PIDs) > 0 {
|
||||||
for _, pid := range args.PIDs {
|
for _, pid := range args.PIDs {
|
||||||
process, err := os.FindProcess(pid)
|
err := syscall.Kill(pid, sig)
|
||||||
if err != nil {
|
|
||||||
common.PrintToStderr(fmt.Sprintf("error finding process %v: %v", pid, err))
|
|
||||||
exitCode = 1
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
err = process.Signal(sig)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.PrintToStderr(fmt.Sprintf("kill %v: %v", pid, err))
|
common.PrintToStderr(fmt.Sprintf("kill %v: %v", pid, err))
|
||||||
exitCode = 1
|
exitCode = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user