From: Rafal Krypa Date: Tue, 25 Oct 2016 08:13:07 +0000 (+0200) Subject: Use recently introduced ClientRequest class in security_manager_shm_open X-Git-Tag: submit/tizen_3.0/20161205.022817~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c003fbd310a23c67077386f527fdba3006ee714;p=platform%2Fcore%2Fsecurity%2Fsecurity-manager.git Use recently introduced ClientRequest class in security_manager_shm_open Use helper class for client communication with service instead of manual Serialize/sendToServer/Deserialize. Change-Id: Ia18a9caa03e0f1626487c1048ba5b629fd8109b7 Signed-off-by: Rafal Krypa --- diff --git a/src/client/client-security-manager.cpp b/src/client/client-security-manager.cpp index 82c2407f..c986af0b 100644 --- a/src/client/client-security-manager.cpp +++ b/src/client/client-security-manager.cpp @@ -1533,21 +1533,9 @@ int security_manager_shm_open(const char *name, int oflag, mode_t mode, const ch return -1; auto scopeClose = makeUnique(&fd, [](int *ptr) -> void { if (*ptr >= 0) close(*ptr); }); + ClientRequest request(SecurityModuleCall::SHM_APP_NAME); + int retval = request.send(std::string(name), std::string(app_name)).getStatus(); - MessageBuffer send, recv; - Serialization::Serialize(send, - (int)SecurityModuleCall::SHM_APP_NAME, - std::string(name), - std::string(app_name)); - - int retval = sendToServer(SERVICE_SOCKET, send.Pop(), recv); - if (retval != SECURITY_MANAGER_SUCCESS) { - // Let's propagate errno - LogError("Error in sendToServer. Error code: " << retval); - return -1; - } - - Deserialization::Deserialize(recv, retval); switch(retval) { case SECURITY_MANAGER_SUCCESS: scopeClose.release(); @@ -1577,4 +1565,3 @@ int security_manager_shm_open(const char *name, int oflag, mode_t mode, const ch return -1; }); } -