Do not wait launched application is ready 19/62219/1 accepted/tizen/common/20160317.155430 accepted/tizen/ivi/20160315.121133 accepted/tizen/mobile/20160315.121032 accepted/tizen/tv/20160315.121102 accepted/tizen/wearable/20160315.121117 submit/tizen/20160315.031231 submit/tizen_common/20160316.154911
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 15 Mar 2016 02:35:40 +0000 (11:35 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 15 Mar 2016 02:37:00 +0000 (11:37 +0900)
AMD will wait by itself

Change-Id: I34f2034c66faaf3d9ce5d3923295cab24206db0f
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/debug-launchpad.c

index 729aa7b..c9c4cc4 100644 (file)
@@ -64,10 +64,6 @@ static int __real_send(int clifd, int ret)
 static void __send_result_to_caller(int clifd, int ret, const char* app_path)
 {
        char *cmdline;
-       int wait_count;
-       int cmdline_changed = 0;
-       int cmdline_exist = 0;
-       char sock_path[PATH_MAX];
 
        _W("Check app launching");
 
@@ -80,46 +76,13 @@ static void __send_result_to_caller(int clifd, int ret, const char* app_path)
                return;
        }
 
-       /* check normally was launched? */
-       wait_count = 1;
-       do {
-               cmdline = _proc_get_cmdline_bypid(ret);
-               if (cmdline == NULL) {
-                       _E("error founded when being launched with %d", ret);
-                       if (cmdline_exist || cmdline_changed) {
-                               _E("The app process might be terminated while we are wating %d", ret);
-                               break;
-                       }
-               } else if (strcmp(cmdline, app_path) == 0) {
-                       /* Check app main loop is prepared or not */
-                       _D("-- now wait app mainloop creation --");
-                       free(cmdline);
-                       cmdline_changed = 1;
-
-                       snprintf(sock_path, sizeof(sock_path), "%s/%d/%d",
-                                       SOCKET_PATH, getuid(), ret);
-                       if (access(sock_path, F_OK) == 0)
-                               break;
-
-               } else {
-                       _D("-- now wait cmdline changing --");
-                       cmdline_exist = 1;
-                       free(cmdline);
-               }
-
-               usleep(50 * 1000); /* 50ms sleep */
-               wait_count++;
-       } while (wait_count <= 20); /* max 50*20ms will be sleep */
-
-       if ((!cmdline_exist) && (!cmdline_changed)) {
-               _E("abnormally launched");
-               __real_send(clifd, -1); /* abnormally launched*/
+       cmdline = _proc_get_cmdline_bypid(ret);
+       if (cmdline == NULL) {
+               _E("The app process might be terminated while we are wating %d", ret);
+               __real_send(clifd, -1); /* abnormally launched */
                return;
        }
 
-       if (!cmdline_changed)
-               _E("process launched, but cmdline not changed");
-
        if (__real_send(clifd, ret) < 0) {
                if (kill(ret, SIGKILL) == -1)
                        _E("Failed to send SIGKILL: %d", errno);