Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: runtime/bin/process_impl.dart

Issue 8506013: Correct the sign of exit codes for the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cosmetic Windows changes Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/process_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_impl.dart
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart
index da02ccb578e0922743b2f3bf77c98b88861f9acf..f7d3076cf8f214df47da59cd8e540897fa36fbb9 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_impl.dart
@@ -58,13 +58,15 @@ class _Process implements Process {
// Setup an exit handler to handle internal cleanup and possible
// callback when a process terminates.
_exitHandler.dataHandler = () {
- final int EXIT_DATA_SIZE = 8;
+ final int EXIT_DATA_SIZE = 12;
List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE);
InputStream input = _exitHandler.inputStream;
int exitDataRead = 0;
int exitCode(List<int> ints) {
- return ints[4] + (ints[5] << 8) + (ints[6] << 16) + (ints[7] << 24);
+ var code =
+ ints[4] + (ints[5] << 8) + (ints[6] << 16) + (ints[7] << 24);
+ return (ints[8] == 0) ? code : -code;
Søren Gjesse 2011/11/09 15:12:45 Should we assert that ints[8] is either 0 or 1 and
Mads Ager (google) 2011/11/09 15:37:11 Thanks! Done. I'm using that method to get the neg
}
int exitPid(List<int> ints) {
« no previous file with comments | « no previous file | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698