Skip to content

Commit f8ade8d

Browse files
committed
Use named error return for service#StartShim
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
1 parent 9b4967b commit f8ade8d

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
@@ -159,7 +159,7 @@ func readSpec() (*spec, error) {
159159
return &s, nil
160160
}
161161

162-
func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (string, error) {
162+
func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (_ string, retErr error) {
163163
cmd, err := newCommand(ctx, id, containerdBinary, containerdAddress, containerdTTRPCAddress)
164164
if err != nil {
165165
return "", err
@@ -202,7 +202,7 @@ func (s *service) StartShim(ctx context.Context, id, containerdBinary, container
202202
return "", err
203203
}
204204
defer func() {
205-
if err != nil {
205+
if retErr != nil {
206206
cmd.Process.Kill()
207207
}
208208
}()

0 commit comments

Comments
 (0)