diff --git a/Cargo.toml b/Cargo.toml index 4c6307cf6..fc2c37c4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -196,7 +196,6 @@ tsan = [] [workspace.lints] rust.non_camel_case_types = "allow" -rust.non_upper_case_globals = "allow" rust.unknown_lints = { level = "allow", priority = -1 } rust.unstable_name_collisions = "allow" rustdoc.private_intra_doc_links = "allow" diff --git a/src/builtins/pwd.rs b/src/builtins/pwd.rs index 8f0343334..83b2c07fb 100644 --- a/src/builtins/pwd.rs +++ b/src/builtins/pwd.rs @@ -5,8 +5,8 @@ use crate::{builtins::error::Error, env::Environment as _, err_fmt, wutil::wrealpath}; // The pwd builtin. Respect -P to resolve symbolic links. Respect -L to not do that (the default). -const short_options: &wstr = L!("LPh"); -const long_options: &[WOption] = &[ +const SHORT_OPTIONS: &wstr = L!("LPh"); +const LONG_OPTIONS: &[WOption] = &[ wopt(L!("help"), NoArgument, 'h'), wopt(L!("logical"), NoArgument, 'L'), wopt(L!("physical"), NoArgument, 'P'), @@ -16,7 +16,7 @@ pub fn pwd(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) -> Buil let cmd = argv[0]; let argc = argv.len(); let mut resolve_symlinks = false; - let mut w = WGetopter::new(short_options, long_options, argv); + let mut w = WGetopter::new(SHORT_OPTIONS, LONG_OPTIONS, argv); while let Some(opt) = w.next_opt() { match opt { 'L' => resolve_symlinks = false, diff --git a/src/builtins/realpath.rs b/src/builtins/realpath.rs index 9dd10a4a3..a7f3f9fbf 100644 --- a/src/builtins/realpath.rs +++ b/src/builtins/realpath.rs @@ -16,8 +16,8 @@ struct Options { no_symlinks: bool, } -const short_options: &wstr = L!("+hs"); -const long_options: &[WOption] = &[ +const SHORT_OPTIONS: &wstr = L!("+hs"); +const LONG_OPTIONS: &[WOption] = &[ wopt(L!("no-symlinks"), NoArgument, 's'), wopt(L!("help"), NoArgument, 'h'), ]; @@ -31,7 +31,7 @@ fn parse_options( let mut opts = Options::default(); - let mut w = WGetopter::new(short_options, long_options, args); + let mut w = WGetopter::new(SHORT_OPTIONS, LONG_OPTIONS, args); while let Some(c) = w.next_opt() { match c { diff --git a/src/fork_exec/spawn.rs b/src/fork_exec/spawn.rs index f1a5ed8af..834009569 100644 --- a/src/fork_exec/spawn.rs +++ b/src/fork_exec/spawn.rs @@ -5,7 +5,7 @@ use crate::exec::{PgroupPolicy, is_thompson_shell_script}; use crate::proc::Job; use crate::redirection::Dup2List; -use crate::signal::signals_to_default; +use crate::signal::SIGNALS_TO_DEFAULT; use errno::Errno; use libc::{c_char, posix_spawn_file_actions_t, posix_spawnattr_t}; use std::ffi::{CStr, CString}; @@ -129,7 +129,7 @@ pub fn new( } // Everybody gets default handlers. - attr.set_sigdefault(&signals_to_default)?; + attr.set_sigdefault(&SIGNALS_TO_DEFAULT)?; // Reset the sigmask. let mut sigmask = MaybeUninit::uninit(); diff --git a/src/signal.rs b/src/signal.rs index 43467874a..1de630469 100644 --- a/src/signal.rs +++ b/src/signal.rs @@ -273,7 +273,7 @@ pub fn signal_handle(sig: Signal) { sigaction(sig, &act, std::ptr::null_mut()); } -pub static signals_to_default: LazyLock = LazyLock::new(|| { +pub static SIGNALS_TO_DEFAULT: LazyLock = LazyLock::new(|| { let mut set = MaybeUninit::uninit(); unsafe { libc::sigemptyset(set.as_mut_ptr()) }; for data in SIGNAL_TABLE.iter() {