()
| 60 | } |
| 61 | |
| 62 | func (osp *osProcess) Wait() error { |
| 63 | if osp.finished { |
| 64 | return fmt.Errorf("already waited") |
| 65 | } |
| 66 | osp.finished = true |
| 67 | |
| 68 | state, err := osp.Process.Wait() |
| 69 | if err != nil { |
| 70 | return err |
| 71 | } |
| 72 | |
| 73 | if !state.Success() { |
| 74 | return &exec.ExitError{ProcessState: state} |
| 75 | } |
| 76 | |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | func (osp *osProcess) String() string { |
| 81 | return fmt.Sprintf("pid=%d", osp.Pid) |