| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 _started = true; | 78 _started = true; |
| 79 | 79 |
| 80 // Make sure to activate socket handlers now that the file | 80 // Make sure to activate socket handlers now that the file |
| 81 // descriptors have been set. | 81 // descriptors have been set. |
| 82 _in._activateHandlers(); | 82 _in._activateHandlers(); |
| 83 _out._activateHandlers(); | 83 _out._activateHandlers(); |
| 84 _err._activateHandlers(); | 84 _err._activateHandlers(); |
| 85 | 85 |
| 86 // Setup an exit handler to handle internal cleanup and possible | 86 // Setup an exit handler to handle internal cleanup and possible |
| 87 // callback when a process terminates. | 87 // callback when a process terminates. |
| 88 int exitDataRead = 0; |
| 89 final int EXIT_DATA_SIZE = 8; |
| 90 List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE); |
| 88 _exitHandler.inputStream.dataHandler = () { | 91 _exitHandler.inputStream.dataHandler = () { |
| 89 final int EXIT_DATA_SIZE = 8; | |
| 90 List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE); | |
| 91 int exitDataRead = 0; | |
| 92 | 92 |
| 93 int exitCode(List<int> ints) { | 93 int exitCode(List<int> ints) { |
| 94 var code = _intFromBytes(ints, 0); | 94 var code = _intFromBytes(ints, 0); |
| 95 var negative = _intFromBytes(ints, 4); | 95 var negative = _intFromBytes(ints, 4); |
| 96 assert(negative == 0 || negative == 1); | 96 assert(negative == 0 || negative == 1); |
| 97 return (negative == 0) ? code : -code; | 97 return (negative == 0) ? code : -code; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void handleExit() { | 100 void handleExit() { |
| 101 if (_exitHandlerCallback !== null) { | 101 if (_exitHandlerCallback !== null) { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 Socket _err; | 203 Socket _err; |
| 204 Socket _exitHandler; | 204 Socket _exitHandler; |
| 205 int _pid; | 205 int _pid; |
| 206 bool _closed; | 206 bool _closed; |
| 207 bool _killed; | 207 bool _killed; |
| 208 bool _started; | 208 bool _started; |
| 209 Function _exitHandlerCallback; | 209 Function _exitHandlerCallback; |
| 210 Function _errorHandler; | 210 Function _errorHandler; |
| 211 Function _startHandler; | 211 Function _startHandler; |
| 212 } | 212 } |
| OLD | NEW |