From 614adcd98ec849a5fb5cd8e89671bbf6f51e1fce Mon Sep 17 00:00:00 2001 From: dhy308 Date: Wed, 1 Feb 2023 15:52:32 +0800 Subject: [PATCH] Fix review issues Issue: I6AEEI Test: Build & Boot Devices Signed-off-by: dhy308 --- include/sigchain.h | 48 ------------------- .../test_src_functionalext_sigchain.gni | 2 +- ndk_musl_include/sigchain.h | 45 ----------------- porting/linux/user/src/sigchain/sigchain.c | 1 + 4 files changed, 2 insertions(+), 94 deletions(-) delete mode 100644 include/sigchain.h delete mode 100644 ndk_musl_include/sigchain.h diff --git a/include/sigchain.h b/include/sigchain.h deleted file mode 100644 index cf8692e6..00000000 --- a/include/sigchain.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _SIGCHAIN_H -#define _SIGCHAIN_H - -#ifdef __cplusplus -extern "C" { -#endif -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#include -#include -#include - -static const int SIGCHAIN_ALLOW_NORETURN = 0x1UL; - -/* The action of the sigchain. */ -struct signal_chain_action { - bool (*sca_sigaction)(int, siginfo_t*, void*); - sigset_t sca_mask; - int sca_flags; -}; - -/* Mark the signal to the sigchain, add the special handler to the sigchain. */ -void add_special_signal_handler(int signo, struct signal_chain_action* sa); -/* Remove the special the handler form the sigchain. */ -void remove_special_signal_handler(int signo, bool (*fn)(int, siginfo_t*, void*)); - - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/libc-test/src/functionalext/sigchain/test_src_functionalext_sigchain.gni b/libc-test/src/functionalext/sigchain/test_src_functionalext_sigchain.gni index 91d3b03a..beb39e80 100644 --- a/libc-test/src/functionalext/sigchain/test_src_functionalext_sigchain.gni +++ b/libc-test/src/functionalext/sigchain/test_src_functionalext_sigchain.gni @@ -46,4 +46,4 @@ functionalext_sigchain_list = [ "sigchain_intercept_sigprocmask_b", "sigchain_intercept_sigprocmask_c", "sigchain_intercept_sigprocmask_d", -] \ No newline at end of file +] diff --git a/ndk_musl_include/sigchain.h b/ndk_musl_include/sigchain.h deleted file mode 100644 index 775b5a6c..00000000 --- a/ndk_musl_include/sigchain.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _SIGCHAIN_H -#define _SIGCHAIN_H - -#ifdef __cplusplus -extern "C" { -#endif -#define _GNU_SOURCE -#include -#include -#include - -static const int SIGCHAIN_ALLOW_NORETURN = 0x1UL; - -/* The action of the sigchain. */ -struct signal_chain_action { - bool (*sca_sigaction)(int, siginfo_t*, void*); - sigset_t sca_mask; - int sca_flags; -}; - -/* Mark the signal to the sigchain, add the special handler to the sigchain. */ -void add_special_signal_handler(int signo, struct signal_chain_action* sa); -/* Remove the special the handler form the sigchain. */ -void remove_special_signal_handler(int signo, bool (*fn)(int, siginfo_t*, void*)); - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/porting/linux/user/src/sigchain/sigchain.c b/porting/linux/user/src/sigchain/sigchain.c index 8a624f0f..269445e3 100644 --- a/porting/linux/user/src/sigchain/sigchain.c +++ b/porting/linux/user/src/sigchain/sigchain.c @@ -351,6 +351,7 @@ bool intercept_sigaction(int signo, const struct sigaction *restrict sa, void intercept_sigprocmask(int how, sigset_t *restrict set) { SIGCHAIN_PRINT_DEBUG("%{public}s how: %{public}d", __func__, how); + // Forward directly to the pthread_sigmask When this sigchain is inside a signal handler if (get_handling_signal()) { return; } -- GitLab