Skip to content

Commit

Permalink
Merge pull request #215 from sunfishcode/main
Browse files Browse the repository at this point in the history
Update to rustix 0.36.
  • Loading branch information
eminence authored Nov 30, 2022
2 parents b8a2fc4 + 6fc2557 commit 7f4b0ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 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 @@ default = ["chrono", "flate2"]
serde1 = ["serde"]

[dependencies]
rustix = { version = "0.35.6", features = ["fs", "process", "param", "thread"] }
rustix = { version = "0.36.0", features = ["fs", "process", "param", "thread"] }
bitflags = "1.2"
lazy_static = "1.0.2"
chrono = {version = "0.4.20", optional = true, features = ["clock"], default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
use bitflags::bitflags;
use lazy_static::lazy_static;

use rustix::fd::{AsFd, FromFd};
use rustix::fd::AsFd;
use std::fmt;
use std::fs::{File, OpenOptions};
use std::io::{self, BufRead, BufReader, Read, Seek, Write};
Expand Down Expand Up @@ -388,7 +388,7 @@ impl FileWrapper {
rustix::fs::openat(dirfd, path.as_ref(), OFlags::RDONLY | OFlags::CLOEXEC, Mode::empty())
)?;
Ok(FileWrapper {
inner: File::from_fd(fd.into()),
inner: File::from(fd),
path: p,
})
}
Expand Down
7 changes: 3 additions & 4 deletions src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ use super::*;
use crate::from_iter;
use crate::net::{read_tcp_table, read_udp_table, TcpNetEntry, UdpNetEntry};

use rustix::fd::{AsFd, BorrowedFd, RawFd};
use rustix::fd::{AsFd, BorrowedFd, RawFd, OwnedFd};
use rustix::fs::{AtFlags, Mode, OFlags, RawMode};
use rustix::io::OwnedFd;
#[cfg(feature = "serde1")]
use serde::{Deserialize, Serialize};
use std::ffi::OsStr;
Expand Down Expand Up @@ -1436,7 +1435,7 @@ impl Process {
#[derive(Debug)]
pub struct FDsIter {
inner: rustix::fs::Dir,
inner_fd: rustix::io::OwnedFd,
inner_fd: rustix::fd::OwnedFd,
root: PathBuf,
}

Expand Down Expand Up @@ -1466,7 +1465,7 @@ impl std::iter::Iterator for FDsIter {
pub struct TasksIter {
pid: i32,
inner: rustix::fs::Dir,
inner_fd: rustix::io::OwnedFd,
inner_fd: rustix::fd::OwnedFd,
root: PathBuf,
}

Expand Down
3 changes: 1 addition & 2 deletions src/process/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use std::path::{Path, PathBuf};

use super::{FileWrapper, Io, Schedstat, Stat, Status};
use crate::{ProcError, ProcResult};
use rustix::fd::BorrowedFd;
use rustix::io::OwnedFd;
use rustix::fd::{OwnedFd, BorrowedFd};

/// A task (aka Thread) inside of a [`Process`](crate::process::Process)
///
Expand Down

0 comments on commit 7f4b0ec

Please sign in to comment.