From 69a5b2df9e6ae6dd87cfcacee97d4a819975e71d Mon Sep 17 00:00:00 2001 From: keloyang Date: Wed, 23 Sep 2015 10:48:36 +0800 Subject: [PATCH] no need to use p.cmd.Process.Pid in function, use p.pid() instead. Signed-off-by: keloyang --- libcontainer/process_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcontainer/process_linux.go b/libcontainer/process_linux.go index f191c16ee..05e49af88 100644 --- a/libcontainer/process_linux.go +++ b/libcontainer/process_linux.go @@ -58,7 +58,7 @@ func (p *setnsProcess) signal(sig os.Signal) error { if !ok { return errors.New("os: unsupported signal type") } - return syscall.Kill(p.cmd.Process.Pid, s) + return syscall.Kill(p.pid(), s) } func (p *setnsProcess) start() (err error) { @@ -67,7 +67,7 @@ func (p *setnsProcess) start() (err error) { return newSystemError(err) } if len(p.cgroupPaths) > 0 { - if err := cgroups.EnterPid(p.cgroupPaths, p.cmd.Process.Pid); err != nil { + if err := cgroups.EnterPid(p.cgroupPaths, p.pid()); err != nil { return newSystemError(err) } } @@ -289,7 +289,7 @@ func (p *initProcess) signal(sig os.Signal) error { if !ok { return errors.New("os: unsupported signal type") } - return syscall.Kill(p.cmd.Process.Pid, s) + return syscall.Kill(p.pid(), s) } func (p *initProcess) setExternalDescriptors(newFds []string) {