Fix launch failure check
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 11 Jan 2021 09:13:40 +0000 (18:13 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 12 Jan 2021 00:32:32 +0000 (09:32 +0900)
If the result of sending the launch request is not -ECOMM,
AMD doesn't check whether the retrying count is over 5 or not.

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

index 0dbc405e190366093495fabe06baa91264b2345a..92320afb453bdacf5e57b76d1c2b3335a5b51823 100644 (file)
@@ -3139,11 +3139,14 @@ static int __do_starting_app(struct launch_s *handle, request_h req,
 
        ret = _launchpad_launch(kb, target_uid);
        if (ret < 0) {
-               __failure_count++;
-               _E("[%u] Failed to send launch request. appid(%s), error(%d)",
-                               __failure_count, handle->appid, ret);
+               _E("Failed to send launch request. appid(%s), error(%d)",
+                               handle->appid, ret);
                _noti_send(AMD_NOTI_MSG_LAUNCH_DO_STARTING_APP_CANCEL,
                                ret, 0, NULL, NULL);
+               if (ret != -ECOMM)
+                       return ret;
+
+               __failure_count++;
                if (__failure_count > _config_get_max_launch_failure()) {
                        _launchpad_recover_launcher(target_uid);
                        __failure_count = 0;
index fc3e916c2cae2ee7d2a6ad322de7718abc13d5e8..5a0caf1188a903b88497d7f992547837aa982978 100644 (file)
@@ -210,7 +210,7 @@ int _send_cmd_to_launchpad(const char *pad_type, uid_t uid, int cmd, bundle *kb)
 
        fd = __create_launchpad_client_sock(pad_type, uid);
        if (fd < 0)
-               return -1;
+               return -ECOMM;
 
        res = aul_sock_send_bundle_with_fd(fd, cmd, kb, AUL_SOCK_ASYNC);
        if (res < 0) {