diff --git a/common/appspawn_server.c b/common/appspawn_server.c index 775da70c04afe47b7396dd36ac9bef78f4a6a06f..ad9e2446eede8986ffab31f7e92832720e0e5ae9 100644 --- a/common/appspawn_server.c +++ b/common/appspawn_server.c @@ -15,6 +15,7 @@ #include "appspawn_server.h" +#include #include #include #include @@ -30,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); @@ -117,8 +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()); - _exit(0x7f); // 0x7f user exit + ProcessExit(void); } *childPid = pid; return 0; diff --git a/lite/BUILD.gn b/lite/BUILD.gn index 0026d051f15dd28c2543da90526cef64ca1d9c61..614aa1036143ba97c5dca202215882fd7d37a0f9 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 = [ ".",