Skip to content

Commit

Permalink
Increase nix dependency lower bound to 0.27.1
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Oct 26, 2023
1 parent d72bd39 commit c6ee4e3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
29 changes: 25 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ version = "0.4.14"
optional = true

[dependencies.nix]
version = "0.26.0"
version = "0.27.1"
features = ["fs", "ioctl", "mount", "poll", "process", "sched", "socket"]
optional = true

[dependencies.pretty-hex]
Expand Down
5 changes: 3 additions & 2 deletions src/engine/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use std::{
collections::{hash_map::RandomState, HashMap, HashSet},
fs::File,
io::Read,
os::unix::io::{AsRawFd, FromRawFd, RawFd},
os::fd::AsFd,
os::unix::io::{FromRawFd, RawFd},
path::{Path, PathBuf},
};

Expand Down Expand Up @@ -118,7 +119,7 @@ pub fn set_key_shared(key_fd: RawFd, memory: &mut [u8]) -> StratisResult<usize>
let bytes_read = key_file.read(memory)?;

if bytes_read == MAX_STRATIS_PASS_SIZE {
let mut pollers = [PollFd::new(key_file.as_raw_fd(), PollFlags::POLLIN)];
let mut pollers = [PollFd::new(&key_file.as_fd(), PollFlags::POLLIN)];
let num_events = poll(&mut pollers, 0)?;
if num_events > 0 {
return Err(StratisError::Msg(format!(
Expand Down
4 changes: 2 additions & 2 deletions src/engine/strat_engine/tests/loopbacked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
env,
fs::{File, OpenOptions},
mem::forget,
os::unix::io::AsRawFd,
os::fd::AsFd,
panic,
path::{Path, PathBuf},
sync::Once,
Expand Down Expand Up @@ -59,7 +59,7 @@ impl LoopTestDev {
.unwrap();

nix::unistd::ftruncate(
f.as_raw_fd(),
f.as_fd(),
convert_test!(*size.bytes(), u128, nix::libc::off_t),
)
.unwrap();
Expand Down
9 changes: 5 additions & 4 deletions src/jsonrpc/server/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,11 @@ impl StratisUnixListener {
SockFlag::empty(),
None,
)?;
let flags = OFlag::from_bits(fcntl(fd, FcntlArg::F_GETFL)?).ok_or_else(|| {
StratisError::Msg("Unrecognized flag types returned from fcntl".to_string())
})?;
fcntl(fd, FcntlArg::F_SETFL(flags | OFlag::O_NONBLOCK))?;
let flags =
OFlag::from_bits(fcntl(fd.as_raw_fd(), FcntlArg::F_GETFL)?).ok_or_else(|| {
StratisError::Msg("Unrecognized flag types returned from fcntl".to_string())
})?;
fcntl(fd.as_raw_fd(), FcntlArg::F_SETFL(flags | OFlag::O_NONBLOCK))?;
bind(fd, &UnixAddr::new(path.as_ref())?)?;
listen(fd, 0)?;
Ok(StratisUnixListener {
Expand Down

0 comments on commit c6ee4e3

Please sign in to comment.