!1403 modify process signal

Merge pull request !1403 from 杨浩/0823
This commit is contained in:
openharmony_ci 2024-08-24 07:32:05 +00:00 committed by Gitee
commit f42833fe48
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -174,12 +174,12 @@ static void HandleDiedPid(pid_t pid, uid_t uid, int status)
APPSPAWN_STATIC void ProcessSignal(const struct signalfd_siginfo *siginfo)
{
APPSPAWN_LOGI("ProcessSignal signum %{public}d", siginfo->ssi_signo);
APPSPAWN_LOGI("ProcessSignal signum %{public}d %{public}d", siginfo->ssi_signo, siginfo->ssi_pid);
switch (siginfo->ssi_signo) {
case SIGCHLD: { // delete pid from app map
pid_t pid;
int status;
while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
while ((pid = waitpid(siginfo->ssi_pid, &status, WNOHANG)) > 0) {
HandleDiedPid(pid, siginfo->ssi_uid, status);
}
#if (defined(CJAPP_SPAWN) || defined(NATIVE_SPAWN))