From 34e91f0746adab8e8475ab90385d0066eec010dc Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 15 Mar 2016 11:35:40 +0900 Subject: [PATCH] Do not wait launched application is ready AMD will wait by itself Change-Id: I34f2034c66faaf3d9ce5d3923295cab24206db0f Signed-off-by: Hwankyu Jhun --- src/debug-launchpad.c | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/src/debug-launchpad.c b/src/debug-launchpad.c index 729aa7b..c9c4cc4 100644 --- a/src/debug-launchpad.c +++ b/src/debug-launchpad.c @@ -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); -- 2.7.4