diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-10-04 22:22:46 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-10-04 23:22:20 +0200 |
commit | eaecd30476c718c432f6cc3be065b16a311e49a3 (patch) | |
tree | 53a15e9cf199286632008c96bec37a071a30629e | |
parent | d3b36a6ae184d4e41ba815e6a49fa223e466ecb9 (diff) | |
download | hardware_ril_samsung-ril-eaecd30476c718c432f6cc3be065b16a311e49a3.zip hardware_ril_samsung-ril-eaecd30476c718c432f6cc3be065b16a311e49a3.tar.gz hardware_ril_samsung-ril-eaecd30476c718c432f6cc3be065b16a311e49a3.tar.bz2 |
RIL client open retry at RIL init
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | samsung-ril.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/samsung-ril.c b/samsung-ril.c index 5b191fd..8174e72 100644 --- a/samsung-ril.c +++ b/samsung-ril.c @@ -1462,6 +1462,7 @@ const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, { RIL_RadioFunctions *radio_functions; pthread_attr_t attr; + int failures; unsigned int i; int rc; @@ -1491,7 +1492,16 @@ const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, if (ril_clients[i] == NULL) continue; - rc = ril_client_open(ril_clients[i]); + failures = 0; + + do { + rc = ril_client_open(ril_clients[i]); + if (rc < 0) { + failures++; + usleep(RIL_CLIENT_RETRY_DELAY); + } + } while (rc < 0 && failures < RIL_CLIENT_RETRY_COUNT); + if (rc < 0) goto error; |