more correct open/close code
This commit is contained in:
parent
c4d3ebf07c
commit
214ec97078
@ -288,13 +288,14 @@ func (p *ParentIPC) acceptConn() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParentIPC) Wait() (retErr error) {
|
func (p *ParentIPC) Wait() error {
|
||||||
waitErrCh := make(chan error, 1)
|
waitErrCh := make(chan error, 1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
waitErrCh <- p.cmd.Wait()
|
waitErrCh <- p.cmd.Wait()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
var retErr error
|
||||||
select {
|
select {
|
||||||
case err := <-p.errCh:
|
case err := <-p.errCh:
|
||||||
retErr = fmt.Errorf("ipc internal error: %w", err)
|
retErr = fmt.Errorf("ipc internal error: %w", err)
|
||||||
@ -306,7 +307,7 @@ func (p *ParentIPC) Wait() (retErr error) {
|
|||||||
|
|
||||||
p.cleanup()
|
p.cleanup()
|
||||||
|
|
||||||
return
|
return retErr
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChildIPC struct {
|
type ChildIPC struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user