mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 15:22:38 +00:00
tty: unistd::ttyname takes AsFd instead of RawFd
change introduced by nix 0.28
This commit is contained in:
parent
15cb0242ea
commit
1413054c53
1 changed files with 1 additions and 3 deletions
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
use clap::{crate_version, Arg, ArgAction, Command};
|
use clap::{crate_version, Arg, ArgAction, Command};
|
||||||
use std::io::{IsTerminal, Write};
|
use std::io::{IsTerminal, Write};
|
||||||
use std::os::unix::io::AsRawFd;
|
|
||||||
use uucore::error::{set_exit_code, UResult};
|
use uucore::error::{set_exit_code, UResult};
|
||||||
use uucore::{format_usage, help_about, help_usage};
|
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();
|
let mut stdout = std::io::stdout();
|
||||||
|
|
||||||
// Get the ttyname via nix
|
let name = nix::unistd::ttyname(std::io::stdin());
|
||||||
let name = nix::unistd::ttyname(std::io::stdin().as_raw_fd());
|
|
||||||
|
|
||||||
let write_result = match name {
|
let write_result = match name {
|
||||||
Ok(name) => writeln!(stdout, "{}", name.display()),
|
Ok(name) => writeln!(stdout, "{}", name.display()),
|
||||||
|
|
Loading…
Reference in a new issue