From: Hwankyu Jhun Date: Wed, 25 Sep 2024 23:29:31 +0000 (+0900) Subject: Check amd socket existence before sending a request X-Git-Tag: accepted/tizen/unified/20241004.041858~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f53f4020f06f36c6115ffa9f5fd3f8abe70ea9c;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Check amd socket existence before sending a request Before sending the request to amd, launchpad checks whether the socket exists or not. If it does not exist, launchpad does not connect to amd. Change-Id: I1912d5f477843d73fc68e4d0d458dbd8d6f51528 Signed-off-by: Hwankyu Jhun --- diff --git a/src/lib/launchpad-core/util.cc b/src/lib/launchpad-core/util.cc index 379dfac8..71fd33e6 100644 --- a/src/lib/launchpad-core/util.cc +++ b/src/lib/launchpad-core/util.cc @@ -632,6 +632,8 @@ int Util::SendCmdToAmd(enum AmdCmd cmd) { int Util::SendCmdToAmd(enum AmdCmd cmd, bundle* request, int opt) { try { std::string endpoint = "/run/aul/daemons/.amd-sock"; + if (access(endpoint.c_str(), F_OK) != 0) return -1; + ClientSocket socket; socket.Connect(endpoint); socket.SetReceiveBufferSize(Socket::kSocketMaxBufferSize);