Skip to content

Commit

Permalink
Upgrade to nix 0.29
Browse files Browse the repository at this point in the history
Signed-off-by: Gris Ge <[email protected]>
  • Loading branch information
cathay4t committed Dec 15, 2024
1 parent 9726de7 commit 1cd3a18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ byteorder = "1.4.3"
dhcproto = "0.9.0"
log = "0.4.17"
etherparse = "0.13.0"
nix = { version = "0.27.0", features = ["poll", "time", "event"] }
nix = { version = "0.29.0", features = ["poll", "time", "event"] }
nispor = "1.2.17"
futures = { version = "0.3", default-features = false, features = ["std"] }

Expand Down
4 changes: 2 additions & 2 deletions src/client_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use nix::poll::{PollFd, PollFlags};

use crate::{DhcpError, DhcpV4Client, DhcpV4Config, DhcpV4Lease, ErrorKind};

const POLL_TIMEOUT: libc::c_int = 1000; // milliseconds
const POLL_TIMEOUT: u16 = 1000; // milliseconds

#[derive(Debug)]
struct ShareState {
Expand Down Expand Up @@ -107,7 +107,7 @@ impl std::ops::Drop for DhcpV4ClientAsync {
fn poll_thread(fd: RawFd, share_state: Arc<Mutex<ShareState>>) {
let fd = unsafe { BorrowedFd::borrow_raw(fd) };
let mut poll_fds = [PollFd::new(
&fd,
fd,
PollFlags::POLLIN
| PollFlags::POLLOUT
| PollFlags::POLLHUP
Expand Down
2 changes: 1 addition & 1 deletion src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl DhcpEpoll {
[EpollEvent::empty(); EVENT_BUFFER_COUNT];

loop {
match self.fd.wait(&mut events, 1000 * wait_time) {
match self.fd.wait(&mut events, 1000 * wait_time as u16) {
Ok(c) => {
let mut ret = Vec::new();
for i in &events[..c] {
Expand Down

0 comments on commit 1cd3a18

Please sign in to comment.