Files
sdk/pkg/dartdev/bin/dartdev.dart
T
Ben Konyi c40ebbc65e [ DartDev ] Ignore SIGINT in DartDev process
If a user program installs custom signal handling for SIGINT,
the DartDev instance may exit before its child, potentially causing
confusing behavior and 'zombie' children. By ignoring these signals in
DartDev, the DartDev instance will only exit once its child process
exits.

Fixes https://github.com/dart-lang/sdk/issues/42092

Change-Id: I04bf6d1f375b8bb3a4f7022f2c79ddde3bd5f414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149643
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2020-07-06 03:02:00 +00:00

20 lines
740 B
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:dartdev/dartdev.dart';
import 'package:pedantic/pedantic.dart' show unawaited;
/// The entry point for dartdev.
Future<void> main(List<String> args) async {
// Ignore SIGINT to ensure DartDev doesn't exit before any of its
// spawned children. Draining the stream returned by watch() effectively
// sends the signals to the void.
//
// See https://github.com/dart-lang/sdk/issues/42092 for context.
unawaited(ProcessSignal.sigint.watch().drain());
await runDartdev(args);
}