OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 class _ProcessStartStatus { | 5 class _ProcessStartStatus { |
6 int _errorCode; // Set to OS error code if process start failed. | 6 int _errorCode; // Set to OS error code if process start failed. |
7 String _errorMessage; // Set to OS error message if process start failed. | 7 String _errorMessage; // Set to OS error message if process start failed. |
8 } | 8 } |
9 | 9 |
10 | 10 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 if (stderrEncoding is !Encoding) { | 324 if (stderrEncoding is !Encoding) { |
325 throw new IllegalArgumentException( | 325 throw new IllegalArgumentException( |
326 'stderrEncoding option is not an encoding: $stderrEncoding'); | 326 'stderrEncoding option is not an encoding: $stderrEncoding'); |
327 } | 327 } |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 // Start the underlying process. | 331 // Start the underlying process. |
332 _process = new _Process.start(path, arguments, options); | 332 _process = new _Process.start(path, arguments, options); |
333 | 333 |
| 334 // Make sure stdin is closed. |
| 335 _process.onStart = _process.stdin.close; |
| 336 |
334 // Setup process error handling. | 337 // Setup process error handling. |
335 _process.onError = (e) => _completer.completeException(e); | 338 _process.onError = (e) => _completer.completeException(e); |
336 | 339 |
337 // Setup process exit handling. | 340 // Setup process exit handling. |
338 _process.onExit = (exitCode) { | 341 _process.onExit = (exitCode) { |
339 _exitCode = exitCode; | 342 _exitCode = exitCode; |
340 _checkDone(); | 343 _checkDone(); |
341 }; | 344 }; |
342 | 345 |
343 // Setup stdout handling. | 346 // Setup stdout handling. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 390 |
388 class _ProcessResult implements ProcessResult { | 391 class _ProcessResult implements ProcessResult { |
389 const _ProcessResult(int this.exitCode, | 392 const _ProcessResult(int this.exitCode, |
390 String this.stdout, | 393 String this.stdout, |
391 String this.stderr); | 394 String this.stderr); |
392 | 395 |
393 final int exitCode; | 396 final int exitCode; |
394 final String stdout; | 397 final String stdout; |
395 final String stderr; | 398 final String stderr; |
396 } | 399 } |
OLD | NEW |