From ded3daa090555bc53f3bf8c406c3e03662019c85 Mon Sep 17 00:00:00 2001 From: liangshenglin1 Date: Mon, 30 Aug 2021 04:20:42 +0000 Subject: [PATCH] use pkgName with pid in createSessionServer Signed-off-by: liangshenglin --- ipc/native/src/core/source/ipc_process_skeleton.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ipc/native/src/core/source/ipc_process_skeleton.cpp b/ipc/native/src/core/source/ipc_process_skeleton.cpp index 7c2f9bf8..06eb9f95 100755 --- a/ipc/native/src/core/source/ipc_process_skeleton.cpp +++ b/ipc/native/src/core/source/ipc_process_skeleton.cpp @@ -101,7 +101,8 @@ IPCProcessSkeleton::~IPCProcessSkeleton() std::shared_ptr manager = ISessionService::GetInstance(); if (manager != nullptr) { - (void)manager->RemoveSessionServer(DBINDER_SERVER_PKG_NAME, sessionName_); + std::string pkgName = DBINDER_SERVER_PKG_NAME + "_" + std::to_string(getpid()); + (void)manager->RemoveSessionServer(pkgName, sessionName_); } #endif } @@ -321,7 +322,7 @@ std::string IPCProcessSkeleton::GetLocalDeviceID() { std::lock_guard lockGuard(databusProcMutex_); - std::string pkgName = "DBinderBus"; + std::string pkgName = DBINDER_SERVER_PKG_NAME + "_" + std::to_string(getpid()); NodeBasicInfo nodeBasicInfo; if (GetLocalNodeDeviceInfo(pkgName.c_str(), &nodeBasicInfo) != 0) { DBINDER_LOGE("Get local node device info failed"); @@ -945,8 +946,8 @@ bool IPCProcessSkeleton::CreateSoftbusServer(const std::string &name) DBINDER_LOGE("fail to create softbus callbacks"); return false; } - - int ret = manager->CreateSessionServer(DBINDER_SERVER_PKG_NAME, name, callback); + std::string pkgName = DBINDER_SERVER_PKG_NAME + "_" + std::to_string(getpid()); + int ret = manager->CreateSessionServer(pkgName, name, callback); if (ret != 0) { DBINDER_LOGE("fail to create softbus server"); return false; -- Gitee