Skip to content

Commit 7f69fc8

Browse files
committed
Update dependencies
1 parent 897c511 commit 7f69fc8

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ bytes = "1.4"
2020
libc = "0.2"
2121
log = "0.4"
2222
macaddr = "1.0"
23-
nix = { version = "0.27", features = ["mount", "event", "ioctl", "poll", "fs"] }
23+
nix = { version = "0.28", features = ["mount", "event", "ioctl", "poll", "fs"] }
2424
proc-mounts = "0.3"
25-
strum = { version = "0.25", features = ["derive"] }
25+
strum = { version = "0.26", features = ["derive"] }
2626
tokio = { version = "1.32", features = ["net", "rt", "sync"], optional = true }
2727
uuid = "1"
2828

2929
[dev-dependencies]
30-
env_logger = "0.10"
30+
env_logger = "0.11"
3131
rusb = "0.9"
3232
tempfile = "3"
3333
tokio = { version = "1", features = ["macros", "time"] }

src/function/custom/aio/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! Linux AIO driver.
22
33
use bytes::{Bytes, BytesMut};
4-
use nix::sys::eventfd::{eventfd, EfdFlags};
4+
use nix::sys::eventfd::{self, EfdFlags};
55
use std::{
66
collections::{hash_map::Entry, HashMap, VecDeque},
77
fmt,
88
io::{Error, ErrorKind, Result},
99
mem::{self, MaybeUninit},
1010
ops::Deref,
11-
os::fd::{AsRawFd, OwnedFd, RawFd},
11+
os::fd::{AsRawFd, RawFd},
1212
pin::Pin,
1313
ptr,
1414
sync::{mpsc, mpsc::TryRecvError, Arc},
@@ -22,13 +22,13 @@ pub use sys::opcode;
2222

2323
/// eventfd provided by kernel.
2424
#[derive(Debug, Clone)]
25-
struct EventFd(Arc<OwnedFd>);
25+
struct EventFd(Arc<eventfd::EventFd>);
2626

2727
impl EventFd {
2828
/// Create new eventfd with initial value and semaphore characteristics, if requested.
2929
pub fn new(initval: u32, semaphore: bool) -> Result<Self> {
3030
let flags = if semaphore { EfdFlags::EFD_SEMAPHORE } else { EfdFlags::empty() };
31-
let fd = eventfd(initval, flags)?;
31+
let fd = eventfd::EventFd::from_value_and_flags(initval, flags)?;
3232
Ok(Self(Arc::new(fd)))
3333
}
3434

src/function/custom/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! The Linux kernel configuration option `CONFIG_USB_CONFIGFS_F_FS` must be enabled.
44
55
use bytes::{Bytes, BytesMut};
6-
use nix::poll::{poll, PollFd, PollFlags};
6+
use nix::poll::{poll, PollFd, PollFlags, PollTimeout};
77
use proc_mounts::MountIter;
88
use std::{
99
collections::{hash_map::Entry, HashMap, HashSet},
@@ -12,7 +12,7 @@ use std::{
1212
fs::File,
1313
hash::Hash,
1414
io::{Error, ErrorKind, Read, Result, Write},
15-
os::fd::{AsRawFd, RawFd},
15+
os::fd::{AsFd, AsRawFd, RawFd},
1616
path::{Path, PathBuf},
1717
sync::{
1818
atomic::{AtomicBool, Ordering},
@@ -978,15 +978,14 @@ impl Custom {
978978
fn wait_event_sync(&mut self, timeout: Option<Duration>) -> Result<bool> {
979979
let ep0 = self.ep0()?;
980980

981-
let mut fds = [PollFd::new(&ep0, PollFlags::POLLIN)];
982-
poll(&mut fds, timeout.map(|d| d.as_millis().try_into().unwrap()).unwrap_or(-1))?;
981+
let mut fds = [PollFd::new(ep0.as_fd(), PollFlags::POLLIN)];
982+
poll(&mut fds, timeout.map(|d| d.as_millis().try_into().unwrap()).unwrap_or(PollTimeout::NONE))?;
983983
Ok(fds[0].revents().map(|e| e.contains(PollFlags::POLLIN)).unwrap_or_default())
984984
}
985985

986986
/// Asynchronously wait for an event to be available.
987987
#[cfg(feature = "tokio")]
988988
pub async fn wait_event(&mut self) -> Result<()> {
989-
use std::os::fd::AsFd;
990989
use tokio::io::{unix::AsyncFd, Interest};
991990

992991
let ep0 = self.ep0()?;

0 commit comments

Comments
 (0)