Add workaround for NewProcess on Windows
This commit is contained in:
@@ -37,6 +37,8 @@ func checkAndCreateInstanceLock(name string) (pid int32, err error) {
|
||||
// check if process exists
|
||||
p, err := processInfo.NewProcess(int32(parsedPid))
|
||||
if err == nil {
|
||||
// TODO: remove this workaround as soon as NewProcess really returns an error on windows when the process does not exist
|
||||
// Issue: https://github.com/shirou/gopsutil/issues/729
|
||||
_, err = p.Name()
|
||||
if err == nil {
|
||||
// process exists
|
||||
|
||||
Reference in New Issue
Block a user