Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7d39f2d

Browse files
authoredJan 17, 2017
Merge pull request docker#430 from hqhq/fix_check_error
Fix go vet errors
2 parents 87ece31 + 5d6fa7b commit 7d39f2d

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed
 

‎cmd/containerd-shim/main.go

+12-13
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func start(log *os.File) error {
108108
return nil
109109
}
110110
var exitShim bool
111-
for {
111+
for !exitShim {
112112
select {
113113
case s := <-signals:
114114
switch s {
@@ -122,18 +122,6 @@ func start(log *os.File) error {
122122
}
123123
}
124124
}
125-
// runtime has exited so the shim can also exit
126-
if exitShim {
127-
// kill all processes in the container incase it was not running in
128-
// its own PID namespace
129-
p.killAll()
130-
// wait for all the processes and IO to finish
131-
p.Wait()
132-
// delete the container from the runtime
133-
p.delete()
134-
// the close of the exit fifo will happen when the shim exits
135-
return nil
136-
}
137125
case msg := <-msgC:
138126
switch msg.Type {
139127
case 0:
@@ -153,6 +141,17 @@ func start(log *os.File) error {
153141
}
154142
}
155143
}
144+
145+
// runtime has exited so the shim can also exit
146+
147+
// kill all processes in the container incase it was not running in
148+
// its own PID namespace
149+
p.killAll()
150+
// wait for all the processes and IO to finish
151+
p.Wait()
152+
// delete the container from the runtime
153+
p.delete()
154+
// the close of the exit fifo will happen when the shim exits
156155
return nil
157156
}
158157

‎cmd/containerd-shim/process.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type checkpoint struct {
3636
}
3737

3838
type processState struct {
39-
Terminal bool `json:terminal`
39+
Terminal bool `json:"terminal"`
4040
Exec bool `json:"exec"`
4141
Stdin string `json:"containerdStdin"`
4242
Stdout string `json:"containerdStdout"`

0 commit comments

Comments
 (0)
Please sign in to comment.