mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-21 17:21:14 -03:00
committed by
Johannes Altmanninger
parent
68472da48a
commit
86c052b6ba
@@ -196,7 +196,6 @@ tsan = []
|
|||||||
|
|
||||||
[workspace.lints]
|
[workspace.lints]
|
||||||
rust.non_camel_case_types = "allow"
|
rust.non_camel_case_types = "allow"
|
||||||
rust.non_upper_case_globals = "allow"
|
|
||||||
rust.unknown_lints = { level = "allow", priority = -1 }
|
rust.unknown_lints = { level = "allow", priority = -1 }
|
||||||
rust.unstable_name_collisions = "allow"
|
rust.unstable_name_collisions = "allow"
|
||||||
rustdoc.private_intra_doc_links = "allow"
|
rustdoc.private_intra_doc_links = "allow"
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
use crate::{builtins::error::Error, env::Environment as _, err_fmt, wutil::wrealpath};
|
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).
|
// The pwd builtin. Respect -P to resolve symbolic links. Respect -L to not do that (the default).
|
||||||
const short_options: &wstr = L!("LPh");
|
const SHORT_OPTIONS: &wstr = L!("LPh");
|
||||||
const long_options: &[WOption] = &[
|
const LONG_OPTIONS: &[WOption] = &[
|
||||||
wopt(L!("help"), NoArgument, 'h'),
|
wopt(L!("help"), NoArgument, 'h'),
|
||||||
wopt(L!("logical"), NoArgument, 'L'),
|
wopt(L!("logical"), NoArgument, 'L'),
|
||||||
wopt(L!("physical"), NoArgument, 'P'),
|
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 cmd = argv[0];
|
||||||
let argc = argv.len();
|
let argc = argv.len();
|
||||||
let mut resolve_symlinks = false;
|
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() {
|
while let Some(opt) = w.next_opt() {
|
||||||
match opt {
|
match opt {
|
||||||
'L' => resolve_symlinks = false,
|
'L' => resolve_symlinks = false,
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ struct Options {
|
|||||||
no_symlinks: bool,
|
no_symlinks: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
const short_options: &wstr = L!("+hs");
|
const SHORT_OPTIONS: &wstr = L!("+hs");
|
||||||
const long_options: &[WOption] = &[
|
const LONG_OPTIONS: &[WOption] = &[
|
||||||
wopt(L!("no-symlinks"), NoArgument, 's'),
|
wopt(L!("no-symlinks"), NoArgument, 's'),
|
||||||
wopt(L!("help"), NoArgument, 'h'),
|
wopt(L!("help"), NoArgument, 'h'),
|
||||||
];
|
];
|
||||||
@@ -31,7 +31,7 @@ fn parse_options(
|
|||||||
|
|
||||||
let mut opts = Options::default();
|
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() {
|
while let Some(c) = w.next_opt() {
|
||||||
match c {
|
match c {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
use crate::exec::{PgroupPolicy, is_thompson_shell_script};
|
use crate::exec::{PgroupPolicy, is_thompson_shell_script};
|
||||||
use crate::proc::Job;
|
use crate::proc::Job;
|
||||||
use crate::redirection::Dup2List;
|
use crate::redirection::Dup2List;
|
||||||
use crate::signal::signals_to_default;
|
use crate::signal::SIGNALS_TO_DEFAULT;
|
||||||
use errno::Errno;
|
use errno::Errno;
|
||||||
use libc::{c_char, posix_spawn_file_actions_t, posix_spawnattr_t};
|
use libc::{c_char, posix_spawn_file_actions_t, posix_spawnattr_t};
|
||||||
use std::ffi::{CStr, CString};
|
use std::ffi::{CStr, CString};
|
||||||
@@ -129,7 +129,7 @@ pub fn new(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Everybody gets default handlers.
|
// Everybody gets default handlers.
|
||||||
attr.set_sigdefault(&signals_to_default)?;
|
attr.set_sigdefault(&SIGNALS_TO_DEFAULT)?;
|
||||||
|
|
||||||
// Reset the sigmask.
|
// Reset the sigmask.
|
||||||
let mut sigmask = MaybeUninit::uninit();
|
let mut sigmask = MaybeUninit::uninit();
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ pub fn signal_handle(sig: Signal) {
|
|||||||
sigaction(sig, &act, std::ptr::null_mut());
|
sigaction(sig, &act, std::ptr::null_mut());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static signals_to_default: LazyLock<libc::sigset_t> = LazyLock::new(|| {
|
pub static SIGNALS_TO_DEFAULT: LazyLock<libc::sigset_t> = LazyLock::new(|| {
|
||||||
let mut set = MaybeUninit::uninit();
|
let mut set = MaybeUninit::uninit();
|
||||||
unsafe { libc::sigemptyset(set.as_mut_ptr()) };
|
unsafe { libc::sigemptyset(set.as_mut_ptr()) };
|
||||||
for data in SIGNAL_TABLE.iter() {
|
for data in SIGNAL_TABLE.iter() {
|
||||||
|
|||||||
Reference in New Issue
Block a user