mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
9e5b93565c
pidfile.New() was opening a file in /proc to determine if the owning process still exists. Use syscall.OpenProcess() on Windows instead. Other OSes may also need to be updated here. Signed-off-by: John Starks <jostarks@microsoft.com>
16 lines
230 B
Go
16 lines
230 B
Go
// +build !windows
|
|
|
|
package pidfile
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"strconv"
|
|
)
|
|
|
|
func processExists(pid int) bool {
|
|
if _, err := os.Stat(filepath.Join("/proc", strconv.Itoa(pid))); err == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|