Compare commits
2 Commits
9eb6bc71c4
...
141bec290b
Author | SHA1 | Date | |
---|---|---|---|
141bec290b | |||
c72a35ef72 |
@ -234,16 +234,15 @@ func (p *Container) Serve() error {
|
|||||||
|
|
||||||
// Wait waits for the container init process to exit and releases any resources associated with the [Container].
|
// Wait waits for the container init process to exit and releases any resources associated with the [Container].
|
||||||
func (p *Container) Wait() error {
|
func (p *Container) Wait() error {
|
||||||
if p.cmd == nil {
|
if p.wait == nil {
|
||||||
|
if p.cmd != nil {
|
||||||
|
// pass through error from Cmd
|
||||||
|
return p.cmd.Wait()
|
||||||
|
}
|
||||||
return EINVAL
|
return EINVAL
|
||||||
}
|
}
|
||||||
|
defer func() { close(p.wait); p.cancel(); p.wait = nil }()
|
||||||
err := p.cmd.Wait()
|
return p.cmd.Wait()
|
||||||
p.cancel()
|
|
||||||
if p.wait != nil && err == nil {
|
|
||||||
close(p.wait)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Container) String() string {
|
func (p *Container) String() string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user