mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
uucore: remove unnecessary .as_fd()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user