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

Unified Diff: runtime/bin/process_impl.dart

Issue 11238057: Change Process.kill to return a boolean instead of throwing an exception when kill fails. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months 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 | « runtime/bin/process.dart ('k') | 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 f05a1f10f9eabed15537734aceaed61e5c696255..48670e441efc342e100409b33090133b2fce7cab 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_impl.dart
@@ -228,15 +228,14 @@ class _Process extends NativeFieldWrapperClass1 implements Process {
return _out.outputStream;
}
- void kill([ProcessSignal signal = ProcessSignal.SIGTERM]) {
+ bool kill([ProcessSignal signal = ProcessSignal.SIGTERM]) {
if (signal is! ProcessSignal) {
throw new ArgumentError(
"Argument 'signal' must be a ProcessSignal");
}
assert(_started);
- if (_ended) return;
- if (_kill(this, signal._signalNumber)) return;
- throw new ProcessException("Could not kill process");
+ if (_ended) return false;
+ return _kill(this, signal._signalNumber);
}
bool _kill(Process p, int signal) native "Process_Kill";
« no previous file with comments | « runtime/bin/process.dart ('k') | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698