Skip to content

Commit 08525df

Browse files
committed
libct: replace unix.Kill with os.Process.Signal
Because we should switch to unix.PidFDSendSignal in new kernels, it has been supported in go runtime. We don't need to add fall back to unix.Kill code here. Signed-off-by: lfbzhm <[email protected]>
1 parent e075206 commit 08525df

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

libcontainer/process_linux.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ func (p *setnsProcess) startTime() (uint64, error) {
115115
}
116116

117117
func (p *setnsProcess) signal(sig os.Signal) error {
118-
s, ok := sig.(unix.Signal)
119-
if !ok {
120-
return errors.New("os: unsupported signal type")
121-
}
122-
return unix.Kill(p.pid(), s)
118+
return p.cmd.Process.Signal(sig)
123119
}
124120

125121
func (p *setnsProcess) start() (retErr error) {
@@ -838,11 +834,7 @@ func (p *initProcess) createNetworkInterfaces() error {
838834
}
839835

840836
func (p *initProcess) signal(sig os.Signal) error {
841-
s, ok := sig.(unix.Signal)
842-
if !ok {
843-
return errors.New("os: unsupported signal type")
844-
}
845-
return unix.Kill(p.pid(), s)
837+
return p.cmd.Process.Signal(sig)
846838
}
847839

848840
func (p *initProcess) setExternalDescriptors(newFds []string) {

0 commit comments

Comments
 (0)