fix: harden pi maintenance lifecycle
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
//go:build !windows
|
||||
|
||||
package pi
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func processAlive(pid int) bool {
|
||||
process, err := os.FindProcess(pid)
|
||||
if err != nil { return false }
|
||||
err = process.Signal(syscall.Signal(0))
|
||||
return err == nil || errors.Is(err, syscall.EPERM)
|
||||
}
|
||||
Reference in New Issue
Block a user