mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 20:34:07 +08:00
Rename sigchecker_t to Sigchecker
This matches Rust naming conventions
This commit is contained in:
parent
2848be6b73
commit
603a2d6973
|
@ -5,7 +5,7 @@ use crate::builtins::shared::{
|
|||
STATUS_CMD_OK, STATUS_INVALID_ARGS,
|
||||
};
|
||||
use crate::ffi::{job_t, parser_t, proc_wait_any, Repin};
|
||||
use crate::signal::sigchecker_t;
|
||||
use crate::signal::Sigchecker;
|
||||
use crate::wait_handle::{WaitHandleRef, WaitHandleStore};
|
||||
use crate::wchar::{widestrs, wstr};
|
||||
use crate::wgetopt::{wgetopter_t, wopt, woption, woption_argument_t};
|
||||
|
@ -112,7 +112,7 @@ fn wait_for_completion(
|
|||
return Some(0);
|
||||
}
|
||||
|
||||
let mut sigint = sigchecker_t::new_sighupint();
|
||||
let mut sigint = Sigchecker::new_sighupint();
|
||||
loop {
|
||||
let finished = if any_flag {
|
||||
whs.iter().any(is_completed)
|
||||
|
|
|
@ -10,7 +10,7 @@ use crate::global_safety::RelaxedAtomicBool;
|
|||
use crate::job_group::JobGroup;
|
||||
use crate::path::path_apply_working_directory;
|
||||
use crate::redirection::{RedirectionMode, RedirectionSpecList};
|
||||
use crate::signal::sigchecker_t;
|
||||
use crate::signal::Sigchecker;
|
||||
use crate::topic_monitor::topic_t;
|
||||
use crate::wchar::{wstr, WString, L};
|
||||
use crate::wutil::{perror, wdirname, wstat, wwrite_to_fd};
|
||||
|
@ -789,7 +789,7 @@ pub struct FdOutputStream {
|
|||
fd: RawFd,
|
||||
|
||||
/// Used to check if a SIGINT has been received when EINTR is encountered
|
||||
sigcheck: sigchecker_t,
|
||||
sigcheck: Sigchecker,
|
||||
|
||||
/// Whether we have received an error.
|
||||
errored: bool,
|
||||
|
@ -800,7 +800,7 @@ impl FdOutputStream {
|
|||
assert!(fd >= 0, "Invalid fd");
|
||||
FdOutputStream {
|
||||
fd,
|
||||
sigcheck: sigchecker_t::new(topic_t::sighupint),
|
||||
sigcheck: Sigchecker::new(topic_t::sighupint),
|
||||
errored: false,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,23 +8,23 @@ use crate::wchar_ffi::c_str;
|
|||
use widestring::U32CStr;
|
||||
use widestring_suffix::widestrs;
|
||||
|
||||
/// A sigint_detector_t can be used to check if a SIGINT (or SIGHUP) has been delivered.
|
||||
pub struct sigchecker_t {
|
||||
/// A Sigchecker can be used to check if a SIGINT (or SIGHUP) has been delivered.
|
||||
pub struct Sigchecker {
|
||||
topic: topic_t,
|
||||
gen: generation_t,
|
||||
}
|
||||
|
||||
impl sigchecker_t {
|
||||
impl Sigchecker {
|
||||
/// Create a new checker for the given topic.
|
||||
pub fn new(topic: topic_t) -> sigchecker_t {
|
||||
let mut res = sigchecker_t { topic, gen: 0 };
|
||||
pub fn new(topic: topic_t) -> Self {
|
||||
let mut res = Sigchecker { topic, gen: 0 };
|
||||
// Call check() to update our generation.
|
||||
res.check();
|
||||
res
|
||||
}
|
||||
|
||||
/// Create a new checker for SIGHUP and SIGINT.
|
||||
pub fn new_sighupint() -> sigchecker_t {
|
||||
pub fn new_sighupint() -> Self {
|
||||
Self::new(topic_t::sighupint)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user