Skip to content

Commit ea04599

Browse files
tedyudmcgowan
authored andcommitted
Use named error return for service#StartShim
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
1 parent 7fb6e17 commit ea04599

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/v2/runc/v2/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func readSpec() (*spec, error) {
158158
return &s, nil
159159
}
160160

161-
func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (string, error) {
161+
func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (_ string, retErr error) {
162162
cmd, err := newCommand(ctx, id, containerdBinary, containerdAddress, containerdTTRPCAddress)
163163
if err != nil {
164164
return "", err
@@ -201,7 +201,7 @@ func (s *service) StartShim(ctx context.Context, id, containerdBinary, container
201201
return "", err
202202
}
203203
defer func() {
204-
if err != nil {
204+
if retErr != nil {
205205
cmd.Process.Kill()
206206
}
207207
}()

0 commit comments

Comments
 (0)