tokio: update nix dependency to 0.27.1 (#6190)

This commit is contained in:
Andrew Walbran
2023-12-04 16:09:58 +01:00
committed by GitHub
parent ed4f766c98
commit a0a58d7edd
2 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ signal-hook-registry = { version = "1.1.1", optional = true }
[target.'cfg(unix)'.dev-dependencies]
libc = { version = "0.2.149" }
nix = { version = "0.26", default-features = false, features = ["fs", "socket"] }
nix = { version = "0.27.1", default-features = false, features = ["fs", "socket"] }
[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.48"
+9 -2
View File
@@ -1,7 +1,7 @@
#![warn(rust_2018_idioms)]
#![cfg(all(unix, feature = "full"))]
use std::os::unix::io::{AsRawFd, RawFd};
use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd};
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
@@ -132,7 +132,14 @@ fn socketpair() -> (FileDescriptor, FileDescriptor) {
SockFlag::empty(),
)
.expect("socketpair");
let fds = (FileDescriptor { fd: fd_a }, FileDescriptor { fd: fd_b });
let fds = (
FileDescriptor {
fd: fd_a.into_raw_fd(),
},
FileDescriptor {
fd: fd_b.into_raw_fd(),
},
);
set_nonblocking(fds.0.fd);
set_nonblocking(fds.1.fd);