diff --git a/src/autoload.cpp b/src/autoload.cpp index a3ad207c1..9f13bb8b2 100644 --- a/src/autoload.cpp +++ b/src/autoload.cpp @@ -63,7 +63,6 @@ int autoload_t::unload(const wcstring &cmd) { return this->evict_node(cmd); } int autoload_t::load(const wcstring &cmd, bool reload) { int res; - CHECK_BLOCK(0); ASSERT_IS_MAIN_THREAD(); // TODO: Justify this principal_parser. diff --git a/src/common.h b/src/common.h index b74d6d98d..d99524cd4 100644 --- a/src/common.h +++ b/src/common.h @@ -272,19 +272,6 @@ inline bool is_whitespace(const wchar_t *input) { return is_whitespace(wcstring( [[noreturn]] void __fish_assert(const char *msg, const char *file, size_t line, int error); -/// Check if signals are blocked. If so, print an error message and return from the function -/// performing this check. -#define CHECK_BLOCK(retval) -#if 0 -#define CHECK_BLOCK(retval) \ - if (signal_is_blocked()) { \ - debug(0, "function %s called while blocking signals. ", __func__); \ - bugreport(); \ - show_stackframe(L'E'); \ - return retval; \ - } -#endif - /// Shorthand for wgettext call in situations where a C-style string is needed (e.g., fwprintf()). #define _(wstr) wgettext(wstr).c_str() diff --git a/src/event.cpp b/src/event.cpp index c345edd03..00944d1db 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -254,18 +254,6 @@ static void event_fire_internal(const event_t &event) { } } - // No matches. Time to return. - if (fire.empty()) return; - - if (signal_is_blocked()) { - // Fix for #608. Don't run event handlers while signals are blocked. - input_common_add_callback([event]() { - ASSERT_IS_MAIN_THREAD(); - event_fire(event); - }); - return; - } - // Iterate over our list of matching events. Fire the ones that are still present. for (const shared_ptr &handler : fire) { // Only fire if this event is still present diff --git a/src/input.cpp b/src/input.cpp index bcbc04fab..ea9deb0cb 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -483,8 +483,6 @@ static wchar_t input_read_characters_only() { } wint_t input_readch(bool allow_commands) { - CHECK_BLOCK(R_NULL); - // Clear the interrupted flag. reader_reset_interrupted(); // Search for sequence in mapping tables. diff --git a/src/parser.cpp b/src/parser.cpp index 124fdbb6b..db23ce43c 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -647,7 +647,6 @@ int parser_t::eval(wcstring cmd, const io_chain_t &io, enum block_type_t block_t } void parser_t::eval(parsed_source_ref_t ps, const io_chain_t &io, enum block_type_t block_type) { - CHECK_BLOCK(1); assert(block_type == TOP || block_type == SUBST); if (!ps->tree.empty()) { // Execute the first node. @@ -662,8 +661,6 @@ int parser_t::eval_node(parsed_source_ref_t ps, tnode_t node, const io_chain_ static_assert( std::is_same::value || std::is_same::value, "Unexpected node type"); - CHECK_BLOCK(1); - // Handle cancellation requests. If our block stack is currently empty, then we already did // successfully cancel (or there was nothing to cancel); clear the flag. If our block stack is // not empty, we are still in the process of cancelling; refuse to evaluate anything. diff --git a/src/signal.cpp b/src/signal.cpp index 69dadd325..824e19390 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -29,9 +29,6 @@ struct lookup_entry { const wchar_t *desc; }; -/// The number of signal blocks in place. Increased by signal_block, decreased by signal_unblock. -static int block_count = 0; - /// Lookup table used to convert between signal names and signal ids, etc. static const struct lookup_entry signal_table[] = { #ifdef SIGHUP @@ -413,19 +410,6 @@ void get_signals_with_handlers(sigset_t *set) { } } -void signal_block() { - ASSERT_IS_MAIN_THREAD(); - sigset_t chldset; - - if (!block_count) { - sigfillset(&chldset); - DIE_ON_FAILURE(pthread_sigmask(SIG_BLOCK, &chldset, NULL)); - } - - block_count++; - // debug( 0, L"signal block level increased to %d", block_count ); -} - /// Ensure we did not inherit any blocked signals. See issue #3964. void signal_unblock_all() { sigset_t iset; @@ -433,21 +417,3 @@ void signal_unblock_all() { sigprocmask(SIG_SETMASK, &iset, NULL); } -void signal_unblock() { - ASSERT_IS_MAIN_THREAD(); - - block_count--; - if (block_count < 0) { - debug(0, _(L"Signal block mismatch")); - bugreport(); - FATAL_EXIT(); - } - - if (!block_count) { - sigset_t chldset; - sigfillset(&chldset); - DIE_ON_FAILURE(pthread_sigmask(SIG_UNBLOCK, &chldset, 0)); - } -} - -bool signal_is_blocked() { return static_cast(block_count); } diff --git a/src/signal.h b/src/signal.h index be0e1d23b..8980c8dd6 100644 --- a/src/signal.h +++ b/src/signal.h @@ -29,15 +29,6 @@ void signal_handle(int sig, int do_handle); /// Ensure we did not inherit any blocked signals. See issue #3964. void signal_unblock_all(); -/// Block all signals. -void signal_block(); - -/// Unblock all signals. -void signal_unblock(); - -/// Returns true if signals are being blocked. -bool signal_is_blocked(); - /// Returns signals with non-default handlers. void get_signals_with_handlers(sigset_t *set);