Skip to content

Commit 4c5bf64

Browse files
committed
Check error return values
Both tty.resize and notifySocket.setupSocket return an error which isn't handled in the caller. Fix this and either log or propagate the errors. Found using https://github.com/mvdan/unparam Signed-off-by: Tobias Klauser <[email protected]>
1 parent c6126b2 commit 4c5bf64

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

signals.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,15 @@ func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach
7575
}
7676

7777
// perform the initial tty resize.
78-
tty.resize()
78+
if err := tty.resize(); err != nil {
79+
logrus.Error(err)
80+
}
7981
for s := range h.signals {
8082
switch s {
8183
case unix.SIGWINCH:
82-
tty.resize()
84+
if err := tty.resize(); err != nil {
85+
logrus.Error(err)
86+
}
8387
case unix.SIGCHLD:
8488
exits, err := h.reap()
8589
if err != nil {

utils_linux.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,10 @@ func startContainer(context *cli.Context, spec *specs.Spec, action CtAct, criuOp
371371
}
372372

373373
if notifySocket != nil {
374-
notifySocket.setupSocket()
374+
err := notifySocket.setupSocket()
375+
if err != nil {
376+
return -1, err
377+
}
375378
}
376379

377380
// Support on-demand socket activation by passing file descriptors into the container init process.

0 commit comments

Comments
 (0)