summaryrefslogtreecommitdiff
path: root/internal/askcli/runlock_stale_other.go
blob: 21174c4bebe35db238c7073082cc18c25c3a4610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//go:build !linux

package askcli

import (
	"os"
	"syscall"
)

func lockHolderIsStale(pid int, expectedComm string) bool {
	if pid <= 0 {
		return false
	}
	_ = expectedComm
	proc, err := os.FindProcess(pid)
	if err != nil {
		return true
	}
	if err := proc.Signal(syscall.Signal(0)); err != nil {
		return true
	}
	return false
}