summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-01-19 17:29:55 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-02-28 16:58:25 +0100
commit9540ed9f1bcbc85f198ee8b9550b068ebb7dfdb1 (patch)
tree48f0fa95fc504e3865a37653e30a9247bc627073
parent25c35261a9e52b7eda36ac4f8b84df3aef91a592 (diff)
downloadhardware_replicant_libsamsung-ril-9540ed9f1bcbc85f198ee8b9550b068ebb7dfdb1.tar.gz
hardware_replicant_libsamsung-ril-9540ed9f1bcbc85f198ee8b9550b068ebb7dfdb1.tar.bz2
hardware_replicant_libsamsung-ril-9540ed9f1bcbc85f198ee8b9550b068ebb7dfdb1.zip
ipc: ipc_fmt_loop: be more verbose about loop failures
This enables to distinguish different kind of loop failures. The loop handler comes directly from libsamsung-ipc device drivers, which in turn wrap the vendor kernel interfaces. Given that there is some possible variation between the way that the .loop implementations behaves, it's a good idea to add prints to understand better what is going on in case of issues. With the development of a new set of kernel drivers and libsamsung-ipc device driver for Replicant 11, we had a situation where that code was triggered. Note that, at the time of writing, we are not (yet) aware of any behavior difference with the different .loop implementations, but it would be worth checking if they all behave in the same way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--ipc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ipc.c b/ipc.c
index 92cc765..0f7379d 100644
--- a/ipc.c
+++ b/ipc.c
@@ -406,12 +406,22 @@ int ipc_fmt_loop(struct ril_client *client)
eventfd_t event;
int rc;
- if (client == NULL || client->data == NULL)
+ if (client == NULL) {
+ RIL_LOGE("%s client is NULL", client->name);
+ return -1;
+ } else if (client->data == NULL) {
+ RIL_LOGE("%s client data is NULL", client->name);
return -1;
+ }
data = (struct ipc_fmt_data *) client->data;
- if (data->ipc_client == NULL || data->event_fd < 0)
+ if (data->ipc_client == NULL) {
+ RIL_LOGE("%s data ipc_client is NULL", client->name);
+ return -1;
+ } else if (data->event_fd < 0) {
+ RIL_LOGE("%s data event_fd < 0", client->name);
return -1;
+ }
memset(&fds, 0, sizeof(fds));
fds.fds = (int *) &fds_array;