Skip to content

Commit 05185f7

Browse files
authored
Fix Unix signal registration to use try_into()
1 parent 0125e8f commit 05185f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/unix-signal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
99
#[cfg(unix)]
1010
fn main() -> std::io::Result<()> {
11-
use std::os::unix::{io::AsRawFd, net::UnixStream};
11+
use std::os::unix::net::UnixStream;
1212

1313
use async_io::Async;
1414
use futures_lite::{future, prelude::*};
1515

1616
future::block_on(async {
1717
// Create a Unix stream that receives a byte on each signal occurrence.
1818
let (a, mut b) = Async::<UnixStream>::pair()?;
19-
signal_hook::low_level::pipe::register_raw(signal_hook::consts::SIGINT, a.as_raw_fd())?;
19+
signal_hook::low_level::pipe::register_raw(signal_hook::consts::SIGINT, a.try_into()?)?;
2020
println!("Waiting for Ctrl-C...");
2121

2222
// Receive a byte that indicates the Ctrl-C signal occurred.

0 commit comments

Comments
 (0)