From ef5aacfbe4c4ad0a8d88d03b88fade1c7145c828 Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Thu, 19 May 2022 18:48:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9appspawn=E5=AD=90?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E5=BC=BA=E5=88=B6=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laiguizhong --- common/appspawn_server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/appspawn_server.c b/common/appspawn_server.c index 775da70c..9adc3f80 100644 --- a/common/appspawn_server.c +++ b/common/appspawn_server.c @@ -118,7 +118,9 @@ int AppSpawnProcessMsg(struct AppSpawnContent_ *content, AppSpawnClient *client, content->runChildProcessor(content, client); } APPSPAWN_LOGI("App exit %d.", getpid()); - _exit(0x7f); // 0x7f user exit +#ifndef APPSPAWN_TEST + quick_exit(0); +#endif } *childPid = pid; return 0; -- Gitee From 7b9ba73151bcffebc3504675470e0536e9779584 Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Thu, 19 May 2022 19:21:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=B4=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laiguizhong --- common/appspawn_server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/appspawn_server.c b/common/appspawn_server.c index 9adc3f80..157e638d 100644 --- a/common/appspawn_server.c +++ b/common/appspawn_server.c @@ -15,6 +15,7 @@ #include "appspawn_server.h" +#include #include #include #include -- Gitee From 7c53523244ff707393f76430064a4ebf4bda9039 Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Thu, 19 May 2022 20:23:26 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0OHOS=5FLITE=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laiguizhong --- common/appspawn_server.c | 4 ++++ lite/BUILD.gn | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/appspawn_server.c b/common/appspawn_server.c index 157e638d..d4e86e35 100644 --- a/common/appspawn_server.c +++ b/common/appspawn_server.c @@ -119,8 +119,12 @@ int AppSpawnProcessMsg(struct AppSpawnContent_ *content, AppSpawnClient *client, content->runChildProcessor(content, client); } APPSPAWN_LOGI("App exit %d.", getpid()); +#ifdef OHOS_LITE + _exit(0x7f); // 0x7f user exit +#else #ifndef APPSPAWN_TEST quick_exit(0); +#endif #endif } *childPid = pid; diff --git a/lite/BUILD.gn b/lite/BUILD.gn index 0026d051..614aa103 100644 --- a/lite/BUILD.gn +++ b/lite/BUILD.gn @@ -38,7 +38,10 @@ executable("appspawn") { "-Wno-format-extra-args", ] - defines = [ "_GNU_SOURCE" ] + defines = [ + "_GNU_SOURCE", + "OHOS_LITE", + ] include_dirs = [ ".", -- Gitee From 53d5906881f86b58d8db49d0a1dcc470bd351b2a Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Thu, 19 May 2022 20:55:26 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laiguizhong --- common/appspawn_server.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/common/appspawn_server.c b/common/appspawn_server.c index d4e86e35..ad9e2446 100644 --- a/common/appspawn_server.c +++ b/common/appspawn_server.c @@ -31,6 +31,18 @@ static int NotifyResToParent(struct AppSpawnContent_ *content, AppSpawnClient *c return 0; } +static void ProcessExit(void) +{ + APPSPAWN_LOGI("App exit %d.", getpid()); +#ifdef OHOS_LITE + _exit(0x7f); // 0x7f user exit +#else +#ifndef APPSPAWN_TEST + quick_exit(0); +#endif +#endif +} + int DoStartApp(struct AppSpawnContent_ *content, AppSpawnClient *client, char *longProcName, uint32_t longProcNameLen) { APPSPAWN_LOGI("DoStartApp id %d longProcNameLen %u", client->id, longProcNameLen); @@ -118,14 +130,7 @@ int AppSpawnProcessMsg(struct AppSpawnContent_ *content, AppSpawnClient *client, if (ret == 0 && content->runChildProcessor != NULL) { content->runChildProcessor(content, client); } - APPSPAWN_LOGI("App exit %d.", getpid()); -#ifdef OHOS_LITE - _exit(0x7f); // 0x7f user exit -#else -#ifndef APPSPAWN_TEST - quick_exit(0); -#endif -#endif + ProcessExit(void); } *childPid = pid; return 0; -- Gitee