tty: unistd::ttyname takes AsFd instead of RawFd

change introduced by nix 0.28
This commit is contained in:
Daniel Hofstetter 2024-03-11 16:43:15 +01:00
parent 15cb0242ea
commit 1413054c53

View file

@ -9,7 +9,6 @@
use clap::{crate_version, Arg, ArgAction, Command};
use std::io::{IsTerminal, Write};
use std::os::unix::io::AsRawFd;
use uucore::error::{set_exit_code, UResult};
use uucore::{format_usage, help_about, help_usage};
@ -37,8 +36,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let mut stdout = std::io::stdout();
// Get the ttyname via nix
let name = nix::unistd::ttyname(std::io::stdin().as_raw_fd());
let name = nix::unistd::ttyname(std::io::stdin());
let write_result = match name {
Ok(name) => writeln!(stdout, "{}", name.display()),