Index: tools/testing/dart/android.dart |
diff --git a/tools/testing/dart/android.dart b/tools/testing/dart/android.dart |
index bf83128d37353670ef1292686363cf47953c822d..615d5b0abcbc4bca0773510ab1b7981c47c7e532 100644 |
--- a/tools/testing/dart/android.dart |
+++ b/tools/testing/dart/android.dart |
@@ -333,7 +333,10 @@ class AdbDevice { |
if (index >= 0) { |
exitCode = int.parse( |
lines.last.substring(index + MARKER.length).trim()); |
- exitCode = exitCode.toSigned(8); |
+ if (exitCode > 128 && exitCode <= 128 + 31) { |
+ // Return negative exit codes for signals 1..31 (128+N for signal N) |
+ exitCode = 128 - exitCode; |
+ } |
} else { |
// In case of timeouts, for example, we won't get the exitcode marker. |
assert(result.exitCode != 0); |