Fix wrong exception handling of async request 23/266523/2
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 15 Nov 2021 02:12:14 +0000 (11:12 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 15 Nov 2021 02:23:19 +0000 (11:23 +0900)
If the return value of the __send_app_request() function is zero,
AMD should send the result to the caller with the process ID.

Change-Id: Iab0eada715555c2a47474d05ee6acbea0fddafa4
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_launch.c

index 295cb34..e379383 100644 (file)
@@ -823,10 +823,13 @@ static int __fake_launch_app_async(int cmd, int pid, bundle *kb, request_h req)
        int ret;
 
        ret = __send_app_request(pid, target_uid, cmd, -1, kb);
-       if (ret < 0)
+       if (ret < 0) {
                _E("Failed to send request. pid(%d), cmd(%d)", pid, cmd);
+               _request_send_result(req, ret);
+       } else {
+               _request_send_result(req, pid);
+       }
 
-       _request_send_result(req, ret);
        _D("cmd(%d), pid(%d)", cmd, pid);
        return ret;
 }