Revert "Fix a bug about sending app result" 95/245195/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 5 Oct 2020 08:27:35 +0000 (17:27 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 5 Oct 2020 08:27:40 +0000 (17:27 +0900)
This reverts commit a31db019a4e9b7db2d6292425a2159c437667aa3.

Change-Id: I3227287d5d2f36239e32b6e70bf2e954c7ef5ba8

src/lib/amd_launch.c

index 9ff125f983debbcabeb9df43bfba531d2f816ca6..8a9101dc150944e7507328e08f7f32aa5781c614 100644 (file)
@@ -1544,8 +1544,7 @@ end:
 static int __dispatch_app_result(request_h req)
 {
        bundle *kb;
-       int caller_pid;
-       int caller_pgid;
+       int pid;
        int pgid;
        char tmp_pid[MAX_PID_STR_BUFSZ];
        int res;
@@ -1559,15 +1558,9 @@ static int __dispatch_app_result(request_h req)
        if (kb == NULL)
                return -1;
 
-       caller_pid = __get_caller_pid(kb);
-       if (caller_pid < 0)
-               return AUL_R_ERROR;
-
-       caller_pgid = getpgid(caller_pid);
-       if (caller_pgid < 0) {
-               _E("getpgid() is failed. caller_pid(%d)", caller_pid);
+       pid = __get_caller_pid(kb);
+       if (pid < 0)
                return AUL_R_ERROR;
-       }
 
        pgid = getpgid(_request_get_pid(req));
        if (pgid > 0) {
@@ -1580,7 +1573,7 @@ static int __dispatch_app_result(request_h req)
                return AUL_R_ERROR;
 
        __set_instance_id(kb);
-       app_status = _app_status_find(caller_pgid);
+       app_status = _app_status_find(getpgid(pid));
        appid = _app_status_get_appid(app_status);
 
        _noti_send(AMD_NOTI_MSG_LAUNCH_APP_RESULT_START,
@@ -1591,12 +1584,12 @@ static int __dispatch_app_result(request_h req)
                info = __find_result_info(seq);
 
        if (info) {
-               res = aul_sock_send_bundle_with_fd(info->fd, pgid, kb,
+               res = aul_sock_send_bundle_with_fd(info->fd, pid, kb,
                                AUL_SOCK_NOREPLY);
                __remove_result_info(info);
                __destroy_result_info(info);
        } else {
-               res = aul_sock_send_bundle(caller_pgid, target_uid,
+               res = aul_sock_send_bundle(pid, target_uid,
                                _request_get_cmd(req), kb,
                                AUL_SOCK_NOREPLY);
        }
@@ -1604,7 +1597,7 @@ static int __dispatch_app_result(request_h req)
                res = AUL_R_ERROR;
 
        _noti_send(AMD_NOTI_MSG_LAUNCH_APP_RESULT_END,
-                       caller_pgid, target_uid, GINT_TO_POINTER(res), NULL);
+                       pid, target_uid, GINT_TO_POINTER(res), NULL);
 
        return 0;
 }
@@ -2500,7 +2493,7 @@ static void __set_caller_appinfo(const char *caller_appid, int caller_pid,
 {
        char buf[MAX_PID_STR_BUFSZ];
 
-       snprintf(buf, sizeof(buf), "%d", getpgid(caller_pid));
+       snprintf(buf, sizeof(buf), "%d", caller_pid);
        bundle_del(kb, AUL_K_CALLER_PID);
        bundle_add(kb, AUL_K_CALLER_PID, buf);