File tree Expand file tree Collapse file tree 1 file changed +4
-22
lines changed
fleetspeak/src/e2etesting/setup Expand file tree Collapse file tree 1 file changed +4
-22
lines changed Original file line number Diff line number Diff line change 4
4
"context"
5
5
"errors"
6
6
"fmt"
7
- "io"
8
7
"io/ioutil"
9
8
"os"
10
9
"os/exec"
@@ -71,28 +70,11 @@ func (cc *ComponentsInfo) killAll() {
71
70
}
72
71
}
73
72
74
- // Starts a command and redirects its output to main stdout
73
+ // startCommand starts cmd and redirects its output to main stdout and stderr.
75
74
func startCommand (cmd * exec.Cmd ) error {
76
- stdoutIn , err := cmd .StdoutPipe ()
77
- if err != nil {
78
- return err
79
- }
80
- stderrIn , err := cmd .StderrPipe ()
81
- if err != nil {
82
- return err
83
- }
84
- err = cmd .Start ()
85
- if err != nil {
86
- return fmt .Errorf ("cmd.Start() failed: %v" , err )
87
- }
88
-
89
- go func () {
90
- io .Copy (os .Stdout , stdoutIn )
91
- }()
92
- go func () {
93
- io .Copy (os .Stderr , stderrIn )
94
- }()
95
- return nil
75
+ cmd .Stdout = os .Stdout
76
+ cmd .Stderr = os .Stderr
77
+ return cmd .Start ()
96
78
}
97
79
98
80
func getNewClientIDs (admin sgrpc.AdminClient , startTime time.Time ) ([]string , error ) {
You can’t perform that action at this time.
0 commit comments