tr: replace nix by rustix (#12266)

This commit is contained in:
oech3
2026-05-13 07:53:46 +02:00
committed by GitHub
parent f4a0bb3bcd
commit 0c21cb9c29
2 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ jiff = { workspace = true, optional = true, features = [
"tzdb-concatenated",
] }
rustc-hash = { workspace = true }
rustix = { workspace = true, features = ["fs", "pipe", "process"] }
rustix = { workspace = true, features = ["fs", "net", "pipe", "process"] }
time = { workspace = true, optional = true, features = [
"formatting",
"local-offset",
+7 -8
View File
@@ -1649,20 +1649,19 @@ fn test_broken_pipe_no_error() {
.fails_silently();
}
#[cfg(not(windows))]
#[cfg(unix)]
#[test]
fn test_stdin_is_socket() {
use nix::sys::socket::{AddressFamily, SockFlag, SockType, socketpair};
use nix::unistd::write;
use std::io::Write as _;
let (fd1, fd2) = socketpair(
AddressFamily::Unix,
SockType::Stream,
let (fd1, fd2) = rustix::net::socketpair(
rustix::net::AddressFamily::UNIX,
rustix::net::SocketType::STREAM,
rustix::net::SocketFlags::empty(),
None,
SockFlag::empty(),
)
.unwrap();
write(fd1, b"::").unwrap();
std::fs::File::from(fd1).write_all(b"::").unwrap();
new_ucmd!()
.args(&[":", ";"])
.set_stdin(fd2)