diff options
Diffstat (limited to 'internal/askcli/runlock_stale_other.go')
| -rw-r--r-- | internal/askcli/runlock_stale_other.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/askcli/runlock_stale_other.go b/internal/askcli/runlock_stale_other.go new file mode 100644 index 0000000..21174c4 --- /dev/null +++ b/internal/askcli/runlock_stale_other.go @@ -0,0 +1,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 +} |
