!405 Fix: 修改appspawn 冷启动

Merge pull request !405 from cheng_jinsong/appspawn_0909
This commit is contained in:
openharmony_ci 2022-09-09 10:26:03 +00:00 committed by Gitee
commit df31893987
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -42,12 +42,12 @@ int main(int argc, char *const argv[])
return -1;
}
argvSize = end - start;
}
int isRet = memset_s(argv[0], argvSize, 0, (size_t)argvSize) != EOK;
APPSPAWN_CHECK(!isRet, return -EINVAL, "Failed to memset argv[0]");
isRet = strncpy_s(argv[0], argvSize, APPSPAWN_SERVER_NAME, strlen(APPSPAWN_SERVER_NAME)) != EOK;
APPSPAWN_CHECK(!isRet, return -EINVAL, "strncpy_s appspawn server name error: %d", errno);
int isRet = memset_s(argv[0], argvSize, 0, (size_t)argvSize) != EOK;
APPSPAWN_CHECK(!isRet, return -EINVAL, "Failed to memset argv[0]");
isRet = strncpy_s(argv[0], argvSize, APPSPAWN_SERVER_NAME, strlen(APPSPAWN_SERVER_NAME)) != EOK;
APPSPAWN_CHECK(!isRet, return -EINVAL, "strncpy_s appspawn server name error: %d", errno);
}
APPSPAWN_LOGI("AppSpawnCreateContent argc %d mode %d %u", argc, mode, argvSize);
AppSpawnContent *content = AppSpawnCreateContent(APPSPAWN_SOCKET_NAME, argv[0], argvSize, mode);