Fix some import conventions

This commit is contained in:
Johannes Altmanninger
2025-09-24 13:11:43 +02:00
parent 1b01ac87fa
commit fadb2fac44
3 changed files with 5 additions and 4 deletions

View File

@@ -64,6 +64,7 @@
wchar::prelude::*,
wutil::waccess,
};
use libc::STDIN_FILENO;
#[cfg(feature = "embed-data")]
use rust_embed::RustEmbed;
use std::ffi::{CString, OsStr, OsString};
@@ -371,7 +372,7 @@ fn fish_parse_opt(args: &mut [WString], opts: &mut FishCmdOpts) -> ControlFlow<i
// We are an interactive session if we have not been given an explicit
// command or file to execute and stdin is a tty. Note that the -i or
// --interactive options also force interactive mode.
if opts.batch_cmds.is_empty() && optind == args.len() && isatty(libc::STDIN_FILENO) {
if opts.batch_cmds.is_empty() && optind == args.len() && isatty(STDIN_FILENO) {
set_interactive_session(true);
}

View File

@@ -886,7 +886,7 @@ fn throwing_main() -> i32 {
use crate::io::FdOutputStream;
use crate::io::IoChain;
use crate::io::OutputStream::Fd;
use libc::{STDERR_FILENO, STDOUT_FILENO};
use libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
topic_monitor_init();
threads::init();
@@ -895,7 +895,7 @@ fn throwing_main() -> i32 {
let mut err = Fd(FdOutputStream::new(STDERR_FILENO));
let io_chain = IoChain::new();
let mut streams = IoStreams::new(&mut out, &mut err, &io_chain);
streams.stdin_fd = libc::STDIN_FILENO;
streams.stdin_fd = STDIN_FILENO;
// Using the user's default locale could be a problem if it doesn't use UTF-8 encoding. That's
// because the fish project assumes Unicode UTF-8 encoding in all of its scripts.
//

View File

@@ -298,7 +298,7 @@ fn throwing_main() -> i32 {
return s.builtin_status_code();
}
if !isatty(libc::STDIN_FILENO) {
if !isatty(STDIN_FILENO) {
streams
.err
.appendln(wgettext!("Stdin must be attached to a tty."));