This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Commit 7339655
committed
read until EOF in streamCopy
If either stdoutPipe or stderrPipe reads to EOF, do not close the other
one so that it can read to EOF as well. Otherwise we might lose output
in the other pipe.
This works because if hyperstart ends the stdout/stderr streams, it always
closes the writer part of both pipes. Then io.Copy() will get EOF and
return success here.
Also no need to wait stdin go routine because streamCopy() runs in a go
routine itself thus no one is really waiting out there.
Signed-off-by: Peng Tao <bergwolf@gmail.com>1 parent c6dd76c commit 7339655
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
184 | | - | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
196 | 195 | | |
197 | 196 | | |
198 | | - | |
199 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | | - | |
207 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
0 commit comments