If daemon exited unexpectedly HAL should be stop. With cleanup procedure command socket is closed as first so use that to distinguish correct action. --- android/hal-ipc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/android/hal-ipc.c b/android/hal-ipc.c index 16f2bd3..f753f10 100644 --- a/android/hal-ipc.c +++ b/android/hal-ipc.c @@ -88,8 +88,13 @@ static void *notification_handler(void *data) } /* socket was shutdown */ - if (ret == 0) - break; + if (ret == 0) { + if (cmd_sk == -1) + break; + + error("Notification socket closed, aborting"); + exit(EXIT_FAILURE); + } if (ret < (ssize_t) sizeof(*hal_msg)) { error("Too small notification (%zd bytes), aborting", -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html