From c1d7e6f04dcf6ad19e8988d8a384f584bc4798e9 Mon Sep 17 00:00:00 2001 From: Mr_YX <496043997@qq.com> Date: Thu, 2 Jun 2022 12:29:52 +0000 Subject: [PATCH] Signed-off-by: mr-yx <496043997@qq.com> --- samgr_endpoint/source/samgr_small_ipc_adapter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samgr_endpoint/source/samgr_small_ipc_adapter.c b/samgr_endpoint/source/samgr_small_ipc_adapter.c index a58199c..a0fdbe2 100644 --- a/samgr_endpoint/source/samgr_small_ipc_adapter.c +++ b/samgr_endpoint/source/samgr_small_ipc_adapter.c @@ -49,7 +49,7 @@ int ClientRegisterRemoteEndpoint(SvcIdentity *identity, int token, const char *s void *replyBuf = NULL; MessageOption option; MessageOptionInit(&option); - SvcIdentity *samgr = GetContextObject(); + const SvcIdentity *samgr = GetContextObject(); int err = SendRequest(*samgr, INVALID_INDEX, &req, &reply, option, (uintptr_t *)&replyBuf); if (err == EC_SUCCESS) { @@ -73,7 +73,7 @@ void Listen(Endpoint *endpoint, int token, const char *service, const char *feat return; } ThreadAttr attr = {endpoint->name, MAX_STACK_SIZE, PRI_ABOVE_NORMAL, 0, 0}; - IRegisterEpArg *registerEpArg = SAMGR_Malloc(sizeof(IRegisterEpArg)); + const IRegisterEpArg *registerEpArg = SAMGR_Malloc(sizeof(IRegisterEpArg)); if (registerEpArg == NULL) { HILOG_ERROR(HILOG_MODULE_SAMGR, "IRegisterEpArg Memory is not enough!"); return; @@ -111,7 +111,7 @@ static void *Receive(void *argv) ret = registerEpArg->endpoint->registerEP(®isterEpArg->endpoint->identity, registerEpArg->token, registerEpArg->service, registerEpArg->feature); if (ret == EC_SUCCESS) { - SvcIdentity *samgr = GetContextObject(); + const SvcIdentity *samgr = GetContextObject(); (void)RemoveDeathRecipient(*samgr, registerEpArg->endpoint->deadId); (void)AddDeathRecipient(*samgr, OnSamgrServerExit, registerEpArg->endpoint, ®isterEpArg->endpoint->deadId); @@ -177,7 +177,7 @@ int RegisterIdentity(const SaName *saName, SvcIdentity *saInfo, PolicyTrans **po WriteUint32(&req, saInfo->token); IpcIo reply; void *replyBuf = NULL; - SvcIdentity *samgr = GetContextObject(); + const SvcIdentity *samgr = GetContextObject(); MessageOption option; MessageOptionInit(&option); int ret = SendRequest(*samgr, INVALID_INDEX, &req, &reply, option, -- Gitee