diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2018-06-20 19:00:26 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2018-06-21 12:49:04 +0900 |
commit | 9373ceb4bcc3d4b4073bddb6ef09bd8a07fb76c3 (patch) | |
tree | 233d4d4ca3673f1a66e0fdbc7a076037375bf1a4 | |
parent | ef9cef83dfa04fa93aaed9d79d7553dfc4232c5b (diff) | |
download | aul-1-9373ceb4bcc3d4b4073bddb6ef09bd8a07fb76c3.tar.gz aul-1-9373ceb4bcc3d4b4073bddb6ef09bd8a07fb76c3.tar.bz2 aul-1-9373ceb4bcc3d4b4073bddb6ef09bd8a07fb76c3.zip |
Add a fallback about app launcher tool
- Retries dead signal registration
Change-Id: Ic03de0a6ddaf5d6f713aafc88fcbc18132f6554f
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | tool/app_launcher.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tool/app_launcher.c b/tool/app_launcher.c index bd1f6b44..9970d2c2 100644 --- a/tool/app_launcher.c +++ b/tool/app_launcher.c @@ -365,10 +365,35 @@ static int __cmd_start_run(struct launch_arg *arg) return 0; } +static gboolean __retry_handler(gpointer data) +{ + struct launch_arg *arg = (struct launch_arg *)data; + int r; + + r = aul_app_get_status_bypid_for_uid(arg->pid, arg->uid); + if (r == -1 || r == STATUS_DYING) { + g_main_loop_quit(loop); + return G_SOURCE_REMOVE; + } else if (r < 0) { + return G_SOURCE_CONTINUE; + } + + r = aul_listen_app_dead_signal(__app_dead_signal_cb, arg); + if (r < 0) + return G_SOURCE_CONTINUE; + + return G_SOURCE_REMOVE; +} + static void __cmd_start_finish(struct launch_arg *arg) { + int r; + if (arg->pid > 0 && arg->sync) { - aul_listen_app_dead_signal(__app_dead_signal_cb, arg); + r = aul_listen_app_dead_signal(__app_dead_signal_cb, arg); + if (r < 0) + g_timeout_add(500, __retry_handler, arg); + return; } |