Sfoglia il codice sorgente

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 anni fa
parent
commit
8d6da1e100
1 ha cambiato i file con 1 aggiunte e 2 eliminazioni
  1. 1 2
      pkg/system/process_unix.go

+ 1 - 2
pkg/system/process_unix.go

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