pkg/system: IsProcessAlive() remove redundant type-cast

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-10-15 14:47:43 +02:00
parent 6c829007cc
commit 8d6da1e100
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -7,14 +7,13 @@ import (
"fmt"
"os"
"strings"
"syscall"
"golang.org/x/sys/unix"
)
// IsProcessAlive returns true if process with a given pid is running.
func IsProcessAlive(pid int) bool {
err := unix.Kill(pid, syscall.Signal(0))
err := unix.Kill(pid, 0)
if err == nil || err == unix.EPERM {
return true
}