mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct/int/checkpoint_test: use kill(0) for pid check
os.FindProcess never returns an error on Unix/Linux. Use kill(0) to actually check if the process exists. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func showFile(t *testing.T, fname string) error {
|
||||
@@ -189,7 +190,7 @@ func testCheckpoint(t *testing.T, userns bool) {
|
||||
pid, err = restoreProcessConfig.Pid()
|
||||
ok(t, err)
|
||||
|
||||
_, err = os.FindProcess(pid)
|
||||
err = unix.Kill(pid, 0)
|
||||
ok(t, err)
|
||||
|
||||
_, err = restoreStdinW.WriteString("Hello!")
|
||||
|
||||
Reference in New Issue
Block a user