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

Unified Diff: runtime/bin/vmservice/vmservice_io.dart

Issue 343433004: Wrap signal listening with try catch to fix Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/vmservice_io.dart
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart
index 1a972d0c3e1aff3edd9a3b53c2169cae8124dd31..3b3bc26a34d09e747aeb901128d1bed663897476 100644
--- a/runtime/bin/vmservice/vmservice_io.dart
+++ b/runtime/bin/vmservice/vmservice_io.dart
@@ -44,15 +44,7 @@ void _onSignal(ProcessSignal signal) {
}
}
-main() {
- // Get VMService.
- service = new VMService();
- // Start HTTP server.
- server = new Server(service, _ip, _port);
- if (_autoStart) {
- server.startup();
- }
-
+void registerSignalHandler() {
bool useSIGQUIT = true;
// Listen for SIGQUIT.
if (useSIGQUIT) {
@@ -66,3 +58,19 @@ main() {
}
}
+
+main() {
+ // Get VMService.
+ service = new VMService();
+ // Start HTTP server.
+ server = new Server(service, _ip, _port);
+ if (_autoStart) {
+ server.startup();
+ }
+
+ try {
+ registerSignalHandler();
+ } catch (_) {
+ // Listening for signals will fail on Windows.
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698