mirror of
https://gitee.com/openharmony/startup_appspawn
synced 2024-11-26 16:51:08 +00:00
!1503 add prefork default mode
Merge pull request !1503 from 杨浩/0928prefork
This commit is contained in:
commit
e25b585f91
@ -148,6 +148,11 @@ static inline void DumpStatus(const char *appName, pid_t pid, int status)
|
||||
|
||||
static void HandleDiedPid(pid_t pid, uid_t uid, int status)
|
||||
{
|
||||
AppSpawnContent *content = GetAppSpawnContent();
|
||||
if (pid == content->reservedPid) {
|
||||
APPSPAWN_LOGW("HandleDiedPid with reservedPid %{public}d", pid);
|
||||
content->reservedPid = 0;
|
||||
}
|
||||
AppSpawnedProcess *appInfo = GetSpawnedProcess(pid);
|
||||
if (appInfo == NULL) { // If an exception occurs during app spawning, kill pid, return failed
|
||||
WaitChildDied(pid);
|
||||
@ -1169,8 +1174,9 @@ APPSPAWN_STATIC int AppSpawnClearEnv(AppSpawnMgr *content, AppSpawningCtx *prope
|
||||
static int IsEnablePerfork()
|
||||
{
|
||||
char buffer[32] = {0};
|
||||
int ret = GetParameter("persist.sys.prefork.enable", "false", buffer, sizeof(buffer));
|
||||
return (ret > 0 && strcmp(buffer, "true") == 0);
|
||||
int ret = GetParameter("persist.sys.prefork.enable", "true", buffer, sizeof(buffer));
|
||||
APPSPAWN_LOGV("IsEnablePerfork result %{public}d, %{public}s", ret, buffer);
|
||||
return strcmp(buffer, "true") == 0;
|
||||
}
|
||||
|
||||
AppSpawnContent *AppSpawnCreateContent(const char *socketName, char *longProcName, uint32_t nameLen, int mode)
|
||||
|
Loading…
Reference in New Issue
Block a user