summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-01-10 23:02:12 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-02-28 16:58:24 +0100
commit3693e548bc404af9ced722974cd162c1e7da2825 (patch)
treea332ab6927d3f242a91363d21bc385becea683f4 /client.c
parent2f902f7e9f71a500bcb6dd789670a4ad35d221f7 (diff)
downloadhardware_replicant_libsamsung-ril-3693e548bc404af9ced722974cd162c1e7da2825.tar.gz
hardware_replicant_libsamsung-ril-3693e548bc404af9ced722974cd162c1e7da2825.tar.bz2
hardware_replicant_libsamsung-ril-3693e548bc404af9ced722974cd162c1e7da2825.zip
RIL_Init: Make sure there are prints for each error paths
If libsamsung-ril didn't start (for instance due to issues or because we are porting it to a newer Android version) it is useful to know why. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'client.c')
-rw-r--r--client.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/client.c b/client.c
index 2449ee0..3fa313e 100644
--- a/client.c
+++ b/client.c
@@ -92,11 +92,26 @@ int ril_client_open(struct ril_client *client)
{
int rc = 0;
- if (client == NULL)
+ if (client == NULL) {
+ RIL_LOGD("%s: Skipping open due to Invalid client "
+ "(client is NULL)",
+ __func__);
+ return -1;
+ }
+
+ if (client->handlers == NULL) {
+ RIL_LOGD("%s: Skipping open due to Invalid client "
+ "(client->handlers is NULL)",
+ __func__);
return -1;
+ }
- if (client->handlers == NULL || client->handlers->open == NULL)
+ if (client->handlers->open == NULL) {
+ RIL_LOGD("%s: Skipping open due to Invalid client "
+ "(client->handlers->open is NULL)",
+ __func__);
return -1;
+ }
rc = client->handlers->open(client);
if (rc < 0) {
@@ -193,11 +208,24 @@ int ril_client_loop(struct ril_client *client)
pthread_attr_t attr;
int rc;
- if (client == NULL)
+ if (client == NULL) {
+ RIL_LOGD("%s: Skipping loop due to Invalid client "
+ "(client is NULL)", __func__);
+ return -1;
+ }
+
+ if (client->handlers == NULL) {
+ RIL_LOGD("%s: Skipping loop due to Invalid client "
+ "(client->handlers is NULL)", __func__);
return -1;
+ }
- if (client->handlers == NULL || client->handlers->loop == NULL)
+ if (client->handlers->loop == NULL) {
+ RIL_LOGD("%s: Skipping loop due to Invalid client "
+ "(client->handlers->loop is NULL)",
+ __func__);
return -1;
+ }
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);