summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-07-29 13:14:59 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2016-07-29 13:14:59 +0900
commit69ac0df9d2e377dd7d387262e8278fd66ce03a42 (patch)
treeb4297f66a8d89f272036d9c03144652157df2e11
parent8549676d9cc54c2e44ee93972b82879661f68fb0 (diff)
downloadlaunchpad-69ac0df9d2e377dd7d387262e8278fd66ce03a42.tar.gz
launchpad-69ac0df9d2e377dd7d387262e8278fd66ce03a42.tar.bz2
launchpad-69ac0df9d2e377dd7d387262e8278fd66ce03a42.zip
Wait socket creation
Change-Id: Ic1a45c7f78618725a5ff2568e0fc7760e9fb7d4e Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rwxr-xr-xsrc/launchpad.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/launchpad.c b/src/launchpad.c
index 2728b27..202ccbb 100755
--- a/src/launchpad.c
+++ b/src/launchpad.c
@@ -325,6 +325,8 @@ 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 count = 0;
+ char path[PATH_MAX];
_W("Check app launching");
@@ -337,6 +339,20 @@ static void __send_result_to_caller(int clifd, int ret, const char *app_path)
return;
}
+ snprintf(path, sizeof(path), "/run/aul/apps/%d/%d/.app-sock",
+ getuid(), ret);
+ _D("socket path: %s", path);
+ do {
+ if (access(path, F_OK) == 0) {
+ _D("%s exists", path);
+ break;
+ }
+
+ _D("-- now wait socket creation --");
+ usleep(50 * 1000);
+ count++;
+ } while (count < 20);
+
cmdline = _proc_get_cmdline_bypid(ret);
if (cmdline == NULL) {
_E("The app process might be terminated while we are wating %d",