Skip to content

Commit 424e74e

Browse files
committed
tsort: replace nix by rustix
1 parent 8dd5f8f commit 424e74e

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uu/tsort/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ uucore = { workspace = true }
2828
rustc-hash = { workspace = true }
2929

3030
[target.'cfg(unix)'.dependencies]
31-
nix = { workspace = true, features = ["fs"] }
31+
rustix = { workspace = true, features = ["fs"] }
3232

3333
[[bin]]
3434
name = "tsort"

src/uu/tsort/src/tsort.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
8787
target_os = "freebsd",
8888
))]
8989
{
90-
use nix::fcntl::{PosixFadviseAdvice, posix_fadvise};
90+
use rustix::fs::{Advice, fadvise};
9191
use std::os::unix::io::AsFd;
9292

93-
posix_fadvise(
93+
fadvise(
9494
file.as_fd(),
95-
0, // offset 0 => from the start of the file
96-
0, // length 0 => for the whole file
97-
PosixFadviseAdvice::POSIX_FADV_SEQUENTIAL,
95+
0, // offset 0 => from the start of the file
96+
None, // None => for the whole file
97+
Advice::Sequential,
9898
)
9999
.ok();
100100
}

0 commit comments

Comments
 (0)