Fix socket pair requests 87/192287/2
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 2 Nov 2018 04:47:07 +0000 (13:47 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Fri, 2 Nov 2018 05:04:53 +0000 (05:04 +0000)
Requires:
 - https://review.tizen.org/gerrit/#/c/192266/ [amd]
 - https://review.tizen.org/gerrit/#/c/192286/ [aul-1]
 - https://review.tizen.org/gerrit/#/c/192287/ [rpc-port]

Change-Id: I2946e94cd5d27db859eec809ef610b6bbc90c079
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/fdbroker-internal.cc
src/fdbroker-internal.h

index aa234c7..010d555 100644 (file)
@@ -143,12 +143,14 @@ FdBroker::SocketPair::~SocketPair() {
     close(socks_[RECEIVER]);
 }
 
-int FdBroker::SocketPair::Request() {
+int FdBroker::SocketPair::Request(const std::string& target_appid,
+                                  const std::string& port_name) {
   if (mock_) {
     return socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, socks_);
   }
 
-  if (aul_rpc_port_create_socket_pair(&socks_) != AUL_R_OK) {
+  if (aul_rpc_port_create_socket_pair(target_appid.c_str(),
+      port_name.c_str(), &socks_) != AUL_R_OK) {
     LOGE("error create socket pair");
     return -1;
   }
@@ -243,9 +245,9 @@ int FdBroker::Send(const std::string& target_appid,
     return -1;
   }
 
-  if (main_sock_pair.Request() != 0)
+  if (main_sock_pair.Request(target_appid, port_name) != 0)
     return -1;
-  if (delegate_sock_pair.Request() != 0)
+  if (delegate_sock_pair.Request(target_appid, port_name) != 0)
     return -1;
 
   if (mock_) {
index e9b15b8..510c992 100644 (file)
@@ -115,7 +115,7 @@ class FdBroker {
     explicit SocketPair(bool mock = false);
     ~SocketPair();
 
-    int Request();
+    int Request(const std::string& target_appid, const std::string& port_name);
     void RequestMock();
     int Get(Type t) const;
     int Detach(Type t);