diff options
Diffstat (limited to 'internal/lock/lock.go')
| -rw-r--r-- | internal/lock/lock.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/lock/lock.go b/internal/lock/lock.go index 462b26e..2b98227 100644 --- a/internal/lock/lock.go +++ b/internal/lock/lock.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io/fs" + "math" "os" "path/filepath" "strconv" @@ -156,8 +157,10 @@ func parsePid(s string) (int, bool) { } // running reports whether pid names a process that is currently running. +// A pid outside the kernel's 32-bit range names no process: kill(2) would +// cut it to its low bits and ask about another one. func running(pid int) bool { - if pid <= 0 { + if pid <= 0 || pid > math.MaxInt32 { return false } proc, err := os.FindProcess(pid) |
