diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2013-09-28 16:38:51 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2013-09-28 16:38:51 +0200 |
commit | fd051580b347b09bf43d1fab29cea3d58b113e09 (patch) | |
tree | df76485577c71a1435be41a1b6115f2fe4795263 /ipc.c | |
parent | 233ef2c6769c1c833e89651ae5846e66a5097cfb (diff) | |
download | hardware_ril_samsung-ril-fd051580b347b09bf43d1fab29cea3d58b113e09.zip hardware_ril_samsung-ril-fd051580b347b09bf43d1fab29cea3d58b113e09.tar.gz hardware_ril_samsung-ril-fd051580b347b09bf43d1fab29cea3d58b113e09.tar.bz2 |
Check modem state before RIL requests and properly report it on crash
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'ipc.c')
-rw-r--r-- | ipc.c | 30 |
1 files changed, 24 insertions, 6 deletions
@@ -66,7 +66,7 @@ int ipc_fmt_read_loop(struct ril_client *client) rc = ipc_client_poll(ipc_client, NULL); if (rc < 0) { LOGE("IPC FMT client poll failed, aborting"); - return -1; + goto error; } memset(&info, 0, sizeof(info)); @@ -75,7 +75,7 @@ int ipc_fmt_read_loop(struct ril_client *client) if (ipc_client_recv(ipc_client, &info) < 0) { RIL_CLIENT_UNLOCK(client); LOGE("IPC FMT recv failed, aborting"); - return -1; + goto error; } RIL_CLIENT_UNLOCK(client); @@ -84,7 +84,16 @@ int ipc_fmt_read_loop(struct ril_client *client) ipc_client_response_free(ipc_client, &info); } - return 0; + rc = 0; + goto complete; + +error: + ril_radio_state_update(RADIO_STATE_UNAVAILABLE); + + rc = -1; + +complete: + return rc; } int ipc_fmt_create(struct ril_client *client) @@ -232,7 +241,7 @@ int ipc_rfs_read_loop(struct ril_client *client) rc = ipc_client_poll(ipc_client, NULL); if (rc < 0) { LOGE("IPC RFS client poll failed, aborting"); - return -1; + goto error; } memset(&info, 0, sizeof(info)); @@ -241,7 +250,7 @@ int ipc_rfs_read_loop(struct ril_client *client) if (ipc_client_recv(ipc_client, &info) < 0) { RIL_CLIENT_UNLOCK(client); LOGE("IPC RFS recv failed, aborting"); - return -1; + goto error; } RIL_CLIENT_UNLOCK(client); @@ -250,7 +259,16 @@ int ipc_rfs_read_loop(struct ril_client *client) ipc_client_response_free(ipc_client, &info); } - return 0; + rc = 0; + goto complete; + +error: + ril_radio_state_update(RADIO_STATE_UNAVAILABLE); + + rc = -1; + +complete: + return rc; } int ipc_rfs_create(struct ril_client *client) |