mirror of
https://github.com/openharmony/startup_appspawn.git
synced 2026-08-25 14:29:39 -04:00
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "appspawn_server.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
@@ -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();
|
||||
}
|
||||
*childPid = pid;
|
||||
return 0;
|
||||
|
||||
+4
-1
@@ -38,7 +38,10 @@ executable("appspawn") {
|
||||
"-Wno-format-extra-args",
|
||||
]
|
||||
|
||||
defines = [ "_GNU_SOURCE" ]
|
||||
defines = [
|
||||
"_GNU_SOURCE",
|
||||
"OHOS_LITE",
|
||||
]
|
||||
|
||||
include_dirs = [
|
||||
".",
|
||||
|
||||
Reference in New Issue
Block a user