From d00e259514535779c61a5726705f6881ddbdcf39 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 19 Nov 2013 15:02:42 +0100 Subject: [PATCH] android/hal: Check if command socket was shutdown by peer This will allow to print proper error before exiting. --- android/hal-ipc.c | 6 ++++++ 1 file changed, 6 insertions(+) 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)); -- 2.47.3