Commit 829976d3 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Work around for dart-lang/sdk#28603 (#7805)

parent 83514d67
......@@ -12,6 +12,7 @@ import 'application_package.dart';
import 'base/file_system.dart';
import 'base/io.dart';
import 'base/os.dart';
import 'asset.dart';
......@@ -111,24 +112,21 @@ abstract class ResidentRunner {
void registerSignalHandlers() {
assert(stayResident);
ProcessSignal.SIGINT.watch().listen((ProcessSignal signal) async {
_resetTerminal();
await cleanupAfterSignal();
exit(0);
});
ProcessSignal.SIGTERM.watch().listen((ProcessSignal signal) async {
_resetTerminal();
await cleanupAfterSignal();
exit(0);
});
if (!supportsServiceProtocol)
return;
if (!supportsRestart)
ProcessSignal.SIGINT.watch().listen(_cleanUpAndExit);
if (!os.isWindows) // TODO(goderbauer): enable on Windows when https://github.com/dart-lang/sdk/issues/28603 is fixed
ProcessSignal.SIGTERM.watch().listen(_cleanUpAndExit);
if (!supportsServiceProtocol || !supportsRestart)
return;
ProcessSignal.SIGUSR1.watch().listen(_handleSignal);
ProcessSignal.SIGUSR2.watch().listen(_handleSignal);
}
Future<Null> _cleanUpAndExit(ProcessSignal signal) async {
_resetTerminal();
await cleanupAfterSignal();
exit(0);
}
bool _processingSignal = false;
Future<Null> _handleSignal(ProcessSignal signal) async {
if (_processingSignal) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment