mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Merge pull request #4666 from kolyshkin/pidfd_send_signal
Use pidfd_send_signal under the hood
This commit is contained in:
@@ -116,11 +116,7 @@ func (p *containerProcess) startTime() (uint64, error) {
|
||||
}
|
||||
|
||||
func (p *containerProcess) signal(sig os.Signal) error {
|
||||
s, ok := sig.(unix.Signal)
|
||||
if !ok {
|
||||
return errors.New("os: unsupported signal type")
|
||||
}
|
||||
return unix.Kill(p.pid(), s)
|
||||
return p.cmd.Process.Signal(sig)
|
||||
}
|
||||
|
||||
func (p *containerProcess) externalDescriptors() []string {
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach
|
||||
default:
|
||||
us := s.(unix.Signal)
|
||||
logrus.Debugf("forwarding signal %d (%s) to %d", int(us), unix.SignalName(us), pid1)
|
||||
if err := unix.Kill(pid1, us); err != nil {
|
||||
if err := process.Signal(s); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user