Skip to content
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
8 changes: 4 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ clap_mangen = "0.2"
compare = "0.1.0"
coz = { version = "0.1.3" }
crossterm = "0.29.0"
ctrlc = { version = "3.4.4", features = ["termination"] }
ctrlc = { version = "3.4.7", features = ["termination"] }
dns-lookup = { version = "2.0.4" }
exacl = "0.12.0"
file_diff = "1.0.0"
Expand All @@ -311,7 +311,7 @@ lscolors = { version = "0.20.0", default-features = false, features = [
] }
memchr = "2.7.2"
memmap2 = "0.9.4"
nix = { version = "0.29", default-features = false }
nix = { version = "0.30", default-features = false }
nom = "8.0.0"
notify = { version = "=8.0.0", features = ["macos_kqueue"] }
num-bigint = "0.4.4"
Expand Down
92 changes: 49 additions & 43 deletions fuzz/Cargo.lock

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

4 changes: 2 additions & 2 deletions src/uu/cat/src/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::io::{self, BufWriter, IsTerminal, Read, Write};
#[cfg(unix)]
use std::net::Shutdown;
#[cfg(unix)]
use std::os::fd::{AsFd, AsRawFd};
use std::os::fd::AsFd;
#[cfg(unix)]
use std::os::unix::fs::FileTypeExt;
#[cfg(unix)]
Expand Down Expand Up @@ -372,7 +372,7 @@ fn cat_handle<R: FdReadable>(
#[cfg(unix)]
fn is_appending() -> bool {
let stdout = io::stdout();
let Ok(flags) = fcntl(stdout.as_raw_fd(), FcntlArg::F_GETFL) else {
let Ok(flags) = fcntl(stdout.as_fd(), FcntlArg::F_GETFL) else {
return false;
};
// TODO Replace `1 << 10` with `nix::fcntl::Oflag::O_APPEND`.
Expand Down
9 changes: 3 additions & 6 deletions src/uu/cat/src/splice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
use super::{CatResult, FdReadable, InputHandle};

use nix::unistd;
use std::os::{
fd::AsFd,
unix::io::{AsRawFd, RawFd},
};
use std::os::{fd::AsFd, unix::io::AsRawFd};

use uucore::pipes::{pipe, splice, splice_exact};

Expand Down Expand Up @@ -41,7 +38,7 @@ pub(super) fn write_fast_using_splice<R: FdReadable, S: AsRawFd + AsFd>(
// we can recover by copying the data that we have from the
// intermediate pipe to stdout using normal read/write. Then
// we tell the caller to fall back.
copy_exact(pipe_rd.as_raw_fd(), write_fd, n)?;
copy_exact(&pipe_rd, write_fd, n)?;
return Ok(true);
}
}
Expand All @@ -55,7 +52,7 @@ pub(super) fn write_fast_using_splice<R: FdReadable, S: AsRawFd + AsFd>(
/// Move exactly `num_bytes` bytes from `read_fd` to `write_fd`.
///
/// Panics if not enough bytes can be read.
fn copy_exact(read_fd: RawFd, write_fd: &impl AsFd, num_bytes: usize) -> nix::Result<()> {
fn copy_exact(read_fd: &impl AsFd, write_fd: &impl AsFd, num_bytes: usize) -> nix::Result<()> {
let mut left = num_bytes;
let mut buf = [0; BUF_SIZE];
while left > 0 {
Expand Down
8 changes: 5 additions & 3 deletions src/uu/dd/src/dd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
use std::fs::{File, OpenOptions};
use std::io::{self, Read, Seek, SeekFrom, Stdout, Write};
#[cfg(any(target_os = "linux", target_os = "android"))]
use std::os::fd::AsFd;
#[cfg(any(target_os = "linux", target_os = "android"))]
use std::os::unix::fs::OpenOptionsExt;
#[cfg(unix)]
use std::os::unix::{
Expand Down Expand Up @@ -279,7 +281,7 @@
match self {
Self::File(f) => {
let advice = PosixFadviseAdvice::POSIX_FADV_DONTNEED;
posix_fadvise(f.as_raw_fd(), offset, len, advice)
posix_fadvise(f.as_fd(), offset, len, advice)
}
_ => Err(Errno::ESPIPE), // "Illegal seek"
}
Expand Down Expand Up @@ -649,7 +651,7 @@
match self {
Self::File(f, _) => {
let advice = PosixFadviseAdvice::POSIX_FADV_DONTNEED;
posix_fadvise(f.as_raw_fd(), offset, len, advice)
posix_fadvise(f.as_fd(), offset, len, advice)

Check warning on line 654 in src/uu/dd/src/dd.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/dd/src/dd.rs#L654

Added line #L654 was not covered by tests
}
_ => Err(Errno::ESPIPE), // "Illegal seek"
}
Expand Down Expand Up @@ -784,7 +786,7 @@
#[cfg(any(target_os = "linux", target_os = "android"))]
if let Some(libc_flags) = make_linux_oflags(&settings.oflags) {
nix::fcntl::fcntl(
fx.as_raw().as_raw_fd(),
fx.as_raw().as_fd(),

Check warning on line 789 in src/uu/dd/src/dd.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/dd/src/dd.rs#L789

Added line #L789 was not covered by tests
F_SETFL(OFlag::from_bits_retain(libc_flags)),
)?;
}
Expand Down
Loading
Loading