Merge pull request #487 from LK4D4/not_mask_esrch

Use syscall.Kill instead of p.cmd.Process.Kill
This commit is contained in:
Michael Crosby 2015-03-27 10:53:29 -07:00
commit af371eae76
1 changed files with 13 additions and 4 deletions

View File

@ -4,6 +4,7 @@ package libcontainer
import (
"encoding/json"
"errors"
"io"
"os"
"os/exec"
@ -44,8 +45,12 @@ func (p *setnsProcess) startTime() (string, error) {
return system.GetProcessStartTime(p.pid())
}
func (p *setnsProcess) signal(s os.Signal) error {
return p.cmd.Process.Signal(s)
func (p *setnsProcess) signal(sig os.Signal) error {
s, ok := sig.(syscall.Signal)
if !ok {
return errors.New("os: unsupported signal type")
}
return syscall.Kill(p.cmd.Process.Pid, s)
}
func (p *setnsProcess) start() (err error) {
@ -235,6 +240,10 @@ func (p *initProcess) createNetworkInterfaces() error {
return nil
}
func (p *initProcess) signal(s os.Signal) error {
return p.cmd.Process.Signal(s)
func (p *initProcess) signal(sig os.Signal) error {
s, ok := sig.(syscall.Signal)
if !ok {
return errors.New("os: unsupported signal type")
}
return syscall.Kill(p.cmd.Process.Pid, s)
}