From 958bd0b41603ad9eb96958e7558fdedc4837d76f Mon Sep 17 00:00:00 2001 From: wangmengc Date: Tue, 31 Oct 2023 10:12:47 +0800 Subject: [PATCH] setup_async_signals function NOTFOUND_HOOK macro --- bash-5.1/r_execute_cmd/src/lib.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bash-5.1/r_execute_cmd/src/lib.rs b/bash-5.1/r_execute_cmd/src/lib.rs index 7aedc3f3..75888f0e 100644 --- a/bash-5.1/r_execute_cmd/src/lib.rs +++ b/bash-5.1/r_execute_cmd/src/lib.rs @@ -5725,8 +5725,27 @@ unsafe extern "C" fn execute_builtin_or_function( return result; } +#[no_mangle] +pub unsafe extern "C" fn setup_async_signals() { + if job_control == 0 { + get_original_signal(SIGINT as libc::c_int); + set_signal_handler( + SIGINT as libc::c_int, + SIG_IGN!()); + get_original_signal(SIGQUIT as libc::c_int); + set_signal_handler( + SIGQUIT as libc::c_int, + SIG_IGN!()); + } +} +#[macro_export] +macro_rules! NOTFOUND_HOOK { + () => { + b"command_not_found_handle\0" as *const u8 as *const libc::c_char + }; +} -- Gitee