diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index f408a7d..5b07070 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
static int init(bt_callbacks_t *callbacks)
{
struct hal_msg_cmd_register_module cmd;
- struct hal_msg_rsp_error rsp;
DBG("");
cmd.service_id = HAL_SERVICE_ID_BLUETOOTH;
if (hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_MSG_OP_REGISTER_MODULE,
- sizeof(cmd), &cmd,
- sizeof(rsp), &rsp, NULL) < 0) {
+ sizeof(cmd), &cmd, 0, NULL, NULL) < 0) {
error("Failed to register 'bluetooth' service");
goto fail;
}
cmd.service_id = HAL_SERVICE_ID_SOCK;
if (hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_MSG_OP_REGISTER_MODULE,
- sizeof(cmd), &cmd,
- sizeof(rsp), &rsp, NULL) < 0) {
+ sizeof(cmd), &cmd, 0, NULL, NULL) < 0) {
error("Failed to register 'socket' service");
goto fail;
}
diff --git a/android/hal-ipc.c b/android/hal-ipc.c
index 5b77adf..8d40271 100644
--- a/android/hal-ipc.c
+++ b/android/hal-ipc.c
struct iovec iv[2];
struct hal_msg_hdr hal_msg;
char cmsgbuf[CMSG_SPACE(sizeof(int))];
+ struct hal_msg_rsp_error err;
if (cmd_sk < 0)
return -EBADF;
+ if (!rsp || rsp_len == 0) {
+ memset(&err, 0, sizeof(err));
+ rsp = &err;
+ }
+
memset(&msg, 0, sizeof(msg));
memset(&hal_msg, 0, sizeof(hal_msg));