| 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 _exit(int status) native "Exit"; | 5 _exit(int status) native "Exit"; |
| 6 | 6 |
| 7 class _ProcessStartStatus { | 7 class _ProcessStartStatus { |
| 8 int _errorCode; // Set to OS error code if process start failed. | 8 int _errorCode; // Set to OS error code if process start failed. |
| 9 String _errorMessage; // Set to OS error message if process start failed. | 9 String _errorMessage; // Set to OS error message if process start failed. |
| 10 } | 10 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 _exitHandler, | 142 _exitHandler, |
| 143 status); | 143 status); |
| 144 if (!success) { | 144 if (!success) { |
| 145 close(); | 145 close(); |
| 146 _reportError(new ProcessException(status._errorMessage, | 146 _reportError(new ProcessException(status._errorMessage, |
| 147 status._errorCode)); | 147 status._errorCode)); |
| 148 return; | 148 return; |
| 149 } | 149 } |
| 150 _started = true; | 150 _started = true; |
| 151 | 151 |
| 152 _in._closed = false; |
| 153 _out._closed = false; |
| 154 _err._closed = false; |
| 155 _exitHandler._closed = false; |
| 156 |
| 152 // Make sure to activate socket handlers now that the file | 157 // Make sure to activate socket handlers now that the file |
| 153 // descriptors have been set. | 158 // descriptors have been set. |
| 154 _in._activateHandlers(); | 159 _in._activateHandlers(); |
| 155 _out._activateHandlers(); | 160 _out._activateHandlers(); |
| 156 _err._activateHandlers(); | 161 _err._activateHandlers(); |
| 157 | 162 |
| 158 // Setup an exit handler to handle internal cleanup and possible | 163 // Setup an exit handler to handle internal cleanup and possible |
| 159 // callback when a process terminates. | 164 // callback when a process terminates. |
| 160 int exitDataRead = 0; | 165 int exitDataRead = 0; |
| 161 final int EXIT_DATA_SIZE = 8; | 166 final int EXIT_DATA_SIZE = 8; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 | 391 |
| 387 class _ProcessResult implements ProcessResult { | 392 class _ProcessResult implements ProcessResult { |
| 388 const _ProcessResult(int this.exitCode, | 393 const _ProcessResult(int this.exitCode, |
| 389 String this.stdout, | 394 String this.stdout, |
| 390 String this.stderr); | 395 String this.stderr); |
| 391 | 396 |
| 392 final int exitCode; | 397 final int exitCode; |
| 393 final String stdout; | 398 final String stdout; |
| 394 final String stderr; | 399 final String stderr; |
| 395 } | 400 } |
| OLD | NEW |