Merge pull request #4666 from kolyshkin/pidfd_send_signal

Use pidfd_send_signal under the hood
This commit is contained in:
lfbzhm
2025-03-08 10:41:40 +08:00
committed by GitHub
2 changed files with 2 additions and 6 deletions
+1 -5
View File
@@ -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
View File
@@ -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)
}
}