We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0125e8f commit 05185f7Copy full SHA for 05185f7
examples/unix-signal.rs
@@ -8,15 +8,15 @@
8
9
#[cfg(unix)]
10
fn main() -> std::io::Result<()> {
11
- use std::os::unix::{io::AsRawFd, net::UnixStream};
+ use std::os::unix::net::UnixStream;
12
13
use async_io::Async;
14
use futures_lite::{future, prelude::*};
15
16
future::block_on(async {
17
// Create a Unix stream that receives a byte on each signal occurrence.
18
let (a, mut b) = Async::<UnixStream>::pair()?;
19
- signal_hook::low_level::pipe::register_raw(signal_hook::consts::SIGINT, a.as_raw_fd())?;
+ signal_hook::low_level::pipe::register_raw(signal_hook::consts::SIGINT, a.try_into()?)?;
20
println!("Waiting for Ctrl-C...");
21
22
// Receive a byte that indicates the Ctrl-C signal occurred.
0 commit comments