diff options
author | Sangyoon Jang <s89.jang@samsung.com> | 2015-12-08 15:16:21 +0900 |
---|---|---|
committer | Sangyoon Jang <s89.jang@samsung.com> | 2015-12-14 01:02:05 -0800 |
commit | 572564953395fc5c648a589fd98cf9c6b9faaa5c (patch) | |
tree | 1d305cfd200de2b8054f19327cb6fb0b0c13eb9e | |
parent | 1348106fda75d27045fcfb4c4409065ff7914e99 (diff) | |
download | launchpad-accepted/tizen/wearable/20151214.233948.tar.gz launchpad-accepted/tizen/wearable/20151214.233948.tar.bz2 launchpad-accepted/tizen/wearable/20151214.233948.zip |
Don't wait launched application is readysubmit/tizen/20151214.102838submit/tizen/20151214.102546accepted/tizen/wearable/20151214.234043accepted/tizen/wearable/20151214.233948accepted/tizen/tv/20151214.234022accepted/tizen/tv/20151214.233929accepted/tizen/mobile/20151214.234005accepted/tizen/mobile/20151214.233909
amd will wait by itself
Change-Id: Id01f848eb53936a866df9f9e2fca41d794b2d163
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
-rwxr-xr-x | src/launchpad.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/launchpad.c b/src/launchpad.c index ab99f09..59b50fd 100755 --- a/src/launchpad.c +++ b/src/launchpad.c @@ -343,7 +343,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]; @@ -358,44 +357,14 @@ static void __send_result_to_caller(int clifd, int ret, const char* app_path) __real_send(clifd, ret); 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), "/run/user/%d/%d", getuid(), ret); - if (access(sock_path, F_OK) == 0) - break; - - } else { - _D("-- now wait cmdline changing --"); - cmdline_exist = 1; - free(cmdline); - } - usleep(100 * 1000); /* 100ms sleep*/ - wait_count++; - } while (wait_count <= 50); /* max 100*50ms will be sleep*/ - - if ((!cmdline_exist) && (!cmdline_changed)) { + 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) __kill_process(ret); |