From 65a8179bd64640d3c76767121dbf45ce9b8422ae Mon Sep 17 00:00:00 2001 From: "shashank.p" Date: Wed, 18 May 2016 14:58:19 +0530 Subject: [PATCH] Kill Screen-reader via SIGTERM only if aul_terminate_pid fails(returns a negative value) Change-Id: I8e863f3cc0acc11306eeb6a7e2fce50c9e75b65a Signed-off-by: shashank.p --- bus/at-spi-bus-launcher.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 73c8a73..3f6c917 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -663,6 +663,7 @@ _terminate_screen_reader(A11yBusLauncher *bl) { LOGD("Terminating screen reader"); int ret; + int ret_aul; if (bl->pid <= 0) return FALSE; @@ -677,11 +678,15 @@ _terminate_screen_reader(A11yBusLauncher *bl) } LOGD("terminate process with pid %d", bl->pid); - if (!aul_terminate_pid(bl->pid)) + ret_aul = aul_terminate_pid(bl->pid); + if (ret_aul >= 0) { + LOGD("Terminating with aul_terminate_pid: return is %d", ret_aul); bl->pid = 0; return TRUE; } + else + LOGD("aul_terminate_pid failed: return is %d", ret_aul); LOGD("Unable to terminate process using aul api. Sending SIGTERM signal"); ret = kill(bl->pid, SIGTERM); -- 2.7.4