From 69acd006f7e44db919632c45d06cddffd77e3ebf Mon Sep 17 00:00:00 2001 From: xlei1030 Date: Mon, 14 Mar 2022 17:36:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9appspawn=E5=83=B5?= =?UTF-8?q?=E5=B0=B8=E8=BF=9B=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xlei1030 --- src/appspawn_server.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index 4f99f948..212e6b64 100644 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -187,7 +187,6 @@ void AppSpawnServer::HandleSignal() sigset_t mask; sigemptyset(&mask); sigaddset(&mask, SIGCHLD); - sigaddset(&mask, SIGHUP); sigprocmask(SIG_BLOCK, &mask, nullptr); int signalFd = signalfd(-1, &mask, SFD_CLOEXEC); if (signalFd < 0) { @@ -252,7 +251,6 @@ static void ClearEnvironment(void) sigset_t mask; sigemptyset(&mask); sigaddset(&mask, SIGCHLD); - sigaddset(&mask, SIGTERM); sigprocmask(SIG_UNBLOCK, &mask, nullptr); return; } -- Gitee From de19f60cd6baf298942ca0101f60cdc100a538f6 Mon Sep 17 00:00:00 2001 From: xlei1030 Date: Mon, 14 Mar 2022 22:37:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9A=E5=A2=9E=E5=8A=A0pid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xlei1030 --- src/appspawn_server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index 212e6b64..cef1951d 100644 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -198,6 +198,12 @@ void AppSpawnServer::HandleSignal() if (ret != sizeof(fdsi) || fdsi.ssi_signo != SIGCHLD) { continue; } + pid_t pid; + int status; + while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { + APPSPAWN_LOGE("HandleSignal: %d", pid); + } + std::lock_guard lock(mut_); isChildDie_ = true; childPid_ = fdsi.ssi_pid; -- Gitee