Skip to content

Commit 854fb52

Browse files
authored
Merge pull request #4666 from kolyshkin/pidfd_send_signal
Use pidfd_send_signal under the hood
2 parents aad4d97 + 1afa1b8 commit 854fb52

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

libcontainer/process_linux.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ func (p *containerProcess) startTime() (uint64, error) {
116116
}
117117

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

126122
func (p *containerProcess) externalDescriptors() []string {

signals.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach
114114
default:
115115
us := s.(unix.Signal)
116116
logrus.Debugf("forwarding signal %d (%s) to %d", int(us), unix.SignalName(us), pid1)
117-
if err := unix.Kill(pid1, us); err != nil {
117+
if err := process.Signal(s); err != nil {
118118
logrus.Error(err)
119119
}
120120
}

0 commit comments

Comments
 (0)