()
| 71 | } |
| 72 | |
| 73 | func newProcessComm() (_ *processComm, retErr error) { |
| 74 | var ( |
| 75 | comm processComm |
| 76 | err error |
| 77 | ) |
| 78 | comm.initSockParent, comm.initSockChild, err = utils.NewSockPair("init") |
| 79 | if err != nil { |
| 80 | return nil, fmt.Errorf("unable to create init pipe: %w", err) |
| 81 | } |
| 82 | defer func() { |
| 83 | if retErr != nil { |
| 84 | comm.initSockParent.Close() |
| 85 | comm.initSockChild.Close() |
| 86 | } |
| 87 | }() |
| 88 | |
| 89 | comm.syncSockParent, comm.syncSockChild, err = newSyncSockpair("sync") |
| 90 | if err != nil { |
| 91 | return nil, fmt.Errorf("unable to create sync pipe: %w", err) |
| 92 | } |
| 93 | defer func() { |
| 94 | if retErr != nil { |
| 95 | comm.syncSockParent.Close() |
| 96 | comm.syncSockChild.Close() |
| 97 | } |
| 98 | }() |
| 99 | |
| 100 | comm.logPipeParent, comm.logPipeChild, err = os.Pipe() |
| 101 | if err != nil { |
| 102 | return nil, fmt.Errorf("unable to create log pipe: %w", err) |
| 103 | } |
| 104 | return &comm, nil |
| 105 | } |
| 106 | |
| 107 | func (c *processComm) closeChild() { |
| 108 | _ = c.initSockChild.Close() |
no test coverage detected
searching dependent graphs…