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