diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2013-10-22 15:24:58 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-22 16:58:35 +0300 |
commit | 85556b7d32818eab6f7c4b74d4b5746d183bb70d (patch) | |
tree | f346f693f8d1dfbc85c36d31e3c938616c1b5267 /android/hal-ipc.c | |
parent | 058537f9aa358a1340ac586dddd8a04ea30a9edc (diff) | |
download | bluez-85556b7d32818eab6f7c4b74d4b5746d183bb70d.tar.gz |
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.
Diffstat (limited to 'android/hal-ipc.c')
-rw-r--r-- | android/hal-ipc.c | 9 |
1 files changed, 7 insertions, 2 deletions
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", |