uucore: remove unnecessary .as_fd()

This commit is contained in:
oech3
2026-06-09 14:51:06 +02:00
committed by Daniel Hofstetter
parent 86cc98e343
commit 8e1c58cde0
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -789,7 +789,7 @@ pub fn is_stdin_directory(stdin: &Stdin) -> bool {
#[cfg(unix)]
{
use mode::{S_IFDIR, S_IFMT};
let mode = rustix::fs::fstat(stdin.as_fd()).unwrap().st_mode as u32;
let mode = rustix::fs::fstat(stdin).unwrap().st_mode as u32;
// We use the S_IFMT mask ala S_ISDIR() to avoid mistaking
// sockets for directories.
mode & S_IFMT == S_IFDIR
+1 -1
View File
@@ -662,7 +662,7 @@ pub fn ensure_stdout_not_broken() -> std::io::Result<bool> {
let out = stdout();
// First, check that stdout is a fifo and return true if it's not the case
let stat = fstat(out.as_fd())?;
let stat = fstat(&out)?;
if !SFlag::from_bits_truncate(stat.st_mode).contains(SFlag::S_IFIFO) {
return Ok(true);
}