mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
signal: Add SignalKind for registering signals more easily (#1430)
This avoids having consumers import libc for common signals, and it improves discoverability since users need not be aware that libc contains all supported constants.
This commit is contained in:
@@ -40,7 +40,7 @@ use std::process::{self, ExitStatus};
|
||||
use std::task::Context;
|
||||
use std::task::Poll;
|
||||
use tokio_reactor::{Handle, PollEvented};
|
||||
use tokio_signal::unix::Signal;
|
||||
use tokio_signal::unix::{Signal, SignalKind};
|
||||
|
||||
impl Wait for process::Child {
|
||||
fn id(&self) -> u32 {
|
||||
@@ -99,7 +99,7 @@ pub(crate) fn spawn_child(cmd: &mut process::Command, handle: &Handle) -> io::Re
|
||||
let stdout = stdio(child.stdout.take(), handle)?;
|
||||
let stderr = stdio(child.stderr.take(), handle)?;
|
||||
|
||||
let signal = Signal::with_handle(libc::SIGCHLD, handle)?;
|
||||
let signal = Signal::with_handle(SignalKind::sigchld(), handle)?;
|
||||
|
||||
Ok(SpawnedChild {
|
||||
child: Child {
|
||||
|
||||
Reference in New Issue
Block a user