From: Szymon Janc Date: Tue, 22 Oct 2013 13:24:58 +0000 (+0200) Subject: android/hal: Use notification socket for daemon lifetime tracking X-Git-Tag: android-x86-4.4-r3~7245 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=85556b7d32818eab6f7c4b74d4b5746d183bb70d;p=android-x86%2Fexternal-bluetooth-bluez.git android/hal: Use notification socket for daemon lifetime tracking If daemon exited unexpectedly HAL should be stop. With cleanup procedure command socket is closed as first so use that to distinguish correct action. --- diff --git a/android/hal-ipc.c b/android/hal-ipc.c index 16f2bd375..f753f105e 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",