mirror of
https://github.com/moby/moby.git
synced 2026-08-03 06:30:59 +00:00
[project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
[s390x] switch utsname from unsigned to signed
per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
package pidfile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func processExists(pid int) bool {
|
||||
// OS X does not have a proc filesystem.
|
||||
// Use kill -0 pid to judge if the process exists.
|
||||
err := syscall.Kill(pid, 0)
|
||||
err := unix.Kill(pid, 0)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package pidfile
|
||||
|
||||
import "syscall"
|
||||
import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
const (
|
||||
processQueryLimitedInformation = 0x1000
|
||||
@@ -9,13 +11,13 @@ const (
|
||||
)
|
||||
|
||||
func processExists(pid int) bool {
|
||||
h, err := syscall.OpenProcess(processQueryLimitedInformation, false, uint32(pid))
|
||||
h, err := windows.OpenProcess(processQueryLimitedInformation, false, uint32(pid))
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
var c uint32
|
||||
err = syscall.GetExitCodeProcess(h, &c)
|
||||
syscall.Close(h)
|
||||
err = windows.GetExitCodeProcess(h, &c)
|
||||
windows.Close(h)
|
||||
if err != nil {
|
||||
return c == stillActive
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user