Skip to content

Commit

Permalink
Merge pull request #4666 from kolyshkin/pidfd_send_signal
Browse files Browse the repository at this point in the history
Use pidfd_send_signal under the hood
  • Loading branch information
lifubang authored Mar 8, 2025
2 parents aad4d97 + 1afa1b8 commit 854fb52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions libcontainer/process_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion signals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 854fb52

Please sign in to comment.