From fdd9390196285c21f4e94464940198fed7de0b3a Mon Sep 17 00:00:00 2001 From: caochao Date: Tue, 18 Jan 2022 11:14:04 +0800 Subject: [PATCH] fixed 3ff8297 from https://gitee.com/hdcck/distributedschedule_samgr_lite/pulls/42 fix ipc multithread bugs Signed-off-by: caochao Change-Id: Ia41ccd26098b090a25668597573bc328e70f4979 --- samgr_server/BUILD.gn | 1 + samgr_server/source/samgr_server.c | 7 +++++++ 2 files changed, 8 insertions(+) mode change 100755 => 100644 samgr_server/source/samgr_server.c diff --git a/samgr_server/BUILD.gn b/samgr_server/BUILD.gn index 0807c9c..2c65c45 100644 --- a/samgr_server/BUILD.gn +++ b/samgr_server/BUILD.gn @@ -27,6 +27,7 @@ shared_library("server") { "//third_party/bounds_checking_function/include", "//base/security/permission/interfaces/innerkits/permission_lite", "//base/security/permission/services/permission_lite/pms_base/include", + "//foundation/communication/ipc_lite/frameworks/liteipc/include", ] public_deps = [ diff --git a/samgr_server/source/samgr_server.c b/samgr_server/source/samgr_server.c old mode 100755 new mode 100644 index af681ad..d1a03d0 --- a/samgr_server/source/samgr_server.c +++ b/samgr_server/source/samgr_server.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include "cJSON.h" @@ -167,6 +168,12 @@ static int ProcEndpoint(SamgrServer *server, int32 option, void *origin, IpcIo * SvcIdentity identity = {(uint32)INVALID_INDEX, (uint32)INVALID_INDEX, (uint32)INVALID_INDEX}; (void)GenServiceHandle(&identity, GetCallingTid(origin)); #ifdef __LINUX__ + IpcMsg* data = (IpcMsg*)origin; + if (data == NULL) { + HILOG_ERROR(HILOG_MODULE_SAMGR, "Register Endpoint origin null pointer!"); + return EC_FAILURE; + } + identity.handle = data->target.handle; BinderAcquire(g_server.samgr->context, identity.handle); #endif -- Gitee