diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2013-11-19 15:02:42 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-11-19 16:42:02 +0200 |
commit | d00e259514535779c61a5726705f6881ddbdcf39 (patch) | |
tree | a4f49f4d32105a50903d6308bf82f23168e5e023 /android/hal-ipc.c | |
parent | bf8c55f3de87554884f05a15fc8c79f94116172c (diff) | |
download | bluez-d00e259514535779c61a5726705f6881ddbdcf39.tar.gz |
android/hal: Check if command socket was shutdown by peer
This will allow to print proper error before exiting.
Diffstat (limited to 'android/hal-ipc.c')
-rw-r--r-- | android/hal-ipc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/android/hal-ipc.c b/android/hal-ipc.c index 5d622e103..b19704aa8 100644 --- a/android/hal-ipc.c +++ b/android/hal-ipc.c @@ -356,6 +356,12 @@ int hal_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, void *param, exit(EXIT_FAILURE); } + /* socket was shutdown */ + if (ret == 0) { + error("Command socket closed, aborting"); + exit(EXIT_FAILURE); + } + memset(&msg, 0, sizeof(msg)); memset(&cmd, 0, sizeof(cmd)); |