vendor: add missing deps and remove go get
in .travis.yml
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
parent
9a740a0a42
commit
4a7a8efc2d
129 changed files with 11694 additions and 1733 deletions
30
vendor/github.com/nightlyone/lockfile/lockfile_windows.go
generated
vendored
Normal file
30
vendor/github.com/nightlyone/lockfile/lockfile_windows.go
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
package lockfile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
//For some reason these consts don't exist in syscall.
|
||||
const (
|
||||
error_invalid_parameter = 87
|
||||
code_still_active = 259
|
||||
)
|
||||
|
||||
func isRunning(pid int) (bool, error) {
|
||||
procHnd, err := syscall.OpenProcess(syscall.PROCESS_QUERY_INFORMATION, true, uint32(pid))
|
||||
if err != nil {
|
||||
if scerr, ok := err.(syscall.Errno); ok {
|
||||
if uintptr(scerr) == error_invalid_parameter {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var code uint32
|
||||
err = syscall.GetExitCodeProcess(procHnd, &code)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return code == code_still_active, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue