From 163ea8764c210f3bd59d8c4974c2f153705eb99e Mon Sep 17 00:00:00 2001 From: yh Date: Wed, 30 Oct 2024 16:00:46 +0800 Subject: [PATCH] revert Signed-off-by: yh Change-Id: I0b1408e4a91f6304ce00d62a777b6fdec31612f4 --- standard/appspawn_service.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index c62d9ee5..ca8d5780 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -54,7 +54,6 @@ #define FD_PATH_SIZE 128 #define MAX_MEM_SIZE (4 * 1024) #define APPSPAWN_MSG_USER_CHECK_COUNT 3 -#define PREFORK_PROCESS "apppool" #ifndef PIDFD_NONBLOCK #define PIDFD_NONBLOCK O_NONBLOCK #endif @@ -735,28 +734,6 @@ static void ClearMMAP(int clientId) } } -static int SetPreforkProcessName(AppSpawnContent *content) -{ - int ret = prctl(PR_SET_NAME, PREFORK_PROCESS); - if (ret == -1) { - return errno; - } - - ret = memset_s(content->longProcName, - (size_t)content->longProcNameLen, 0, (size_t)content->longProcNameLen); - if (ret != EOK) { - return EINVAL; - } - - ret = strncpy_s(content->longProcName, content->longProcNameLen, - PREFORK_PROCESS, strlen(PREFORK_PROCESS)); - if (ret != EOK) { - return EINVAL; - } - - return 0; -} - static void ProcessPreFork(AppSpawnContent *content, AppSpawningCtx *property) { APPSPAWN_CHECK(pipe(content->preforkFd) == 0, return, "prefork with prefork pipe failed %{public}d", errno); @@ -773,7 +750,7 @@ static void ProcessPreFork(AppSpawnContent *content, AppSpawningCtx *property) if (content->reservedPid == 0) { (void)close(property->forkCtx.fd[0]); (void)close(property->forkCtx.fd[1]); - int isRet = SetPreforkProcessName(content); + int isRet = prctl(PR_SET_NAME, "apppool"); APPSPAWN_LOGI("prefork process start wait read msg with set processname %{public}d", isRet); AppSpawnClient client = {0, 0}; int infoSize = read(content->parentToChildFd[0], &client, sizeof(AppSpawnClient));