From: Hwankyu Jhun Date: Fri, 2 Nov 2018 04:47:07 +0000 (+0900) Subject: Fix socket pair requests X-Git-Tag: accepted/tizen/5.0/unified/20181106.070446~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F192287%2F2;p=platform%2Fcore%2Fappfw%2Frpc-port.git Fix socket pair requests 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 --- diff --git a/src/fdbroker-internal.cc b/src/fdbroker-internal.cc index aa234c7..010d555 100644 --- a/src/fdbroker-internal.cc +++ b/src/fdbroker-internal.cc @@ -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_) { diff --git a/src/fdbroker-internal.h b/src/fdbroker-internal.h index e9b15b8..510c992 100644 --- a/src/fdbroker-internal.h +++ b/src/fdbroker-internal.h @@ -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);