From b2ac4022ba6199ccd910a85e44683540815b50bf Mon Sep 17 00:00:00 2001 From: lie Date: Tue, 26 Apr 2022 14:45:03 +0800 Subject: [PATCH] delete sigaction and only use signalfd Signed-off-by: lie Change-Id: Ie0f6ea124b5559a27c77f4ba990187841a88ee0e --- src/appspawn_server.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index b5985dc2..06fb2824 100755 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -92,29 +92,11 @@ static constexpr HiLogLabel LABEL = {LOG_CORE, 0, "AppSpawnServer"}; extern "C" { #endif -static void SignalHandler([[maybe_unused]] int sig) -{ - pid_t pid; - int status; - - while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { - APPSPAWN_LOGE("SignalHandler HandleSignal: %d, status: %d", pid, status); - } -} - static void InstallSigHandler() { - struct sigaction sa = {}; - sa.sa_handler = SignalHandler; - int err = sigaction(SIGCHLD, &sa, nullptr); - if (err < 0) { - HiLog::Error(LABEL, "Error installing SIGCHLD handler: %{public}d", errno); - return; - } - struct sigaction sah = {}; sah.sa_handler = SIG_IGN; - err = sigaction(SIGHUP, &sah, nullptr); + int err = sigaction(SIGHUP, &sah, nullptr); if (err < 0) { HiLog::Error(LABEL, "Error installing SIGHUP handler: %{public}d", errno); } -- Gitee