Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to rustix 0.36. #215

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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