Fix warning as error for V2
Change-Id: I70cfd971fda629011ba1be84fef15afea196d393
diff --git a/mbtk/mbtk_rild_v2/src/main.c b/mbtk/mbtk_rild_v2/src/main.c
index c1a20c8..e2020fc 100755
--- a/mbtk/mbtk_rild_v2/src/main.c
+++ b/mbtk/mbtk_rild_v2/src/main.c
@@ -32,12 +32,14 @@
#include "mbtk_str.h"
#include "mbtk_queue.h"
+#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(exp) ({ \
typeof (exp) _rc; \
do { \
_rc = (exp); \
} while (_rc == -1 && errno == EINTR); \
_rc; })
+#endif
#define BUFFER_SIZE 2048
#define UEVENT_USIM_DEV "/devices/virtual/usim_event/usim0"
@@ -176,7 +178,7 @@
if(!ril_net_ready) {
if(access(MBTK_BOOT_NET_READY , X_OK) == 0) {
LOGD("Exec : %s", MBTK_BOOT_NET_READY);
- system(MBTK_BOOT_NET_READY);
+ mbtk_system(MBTK_BOOT_NET_READY);
} else {
LOGE("%s can not exec.", MBTK_BOOT_NET_READY);
}
@@ -192,7 +194,7 @@
if(!ril_server_ready) {
if(access(MBTK_BOOT_SERVER_READY , X_OK) == 0) {
LOGD("Exec : %s", MBTK_BOOT_SERVER_READY);
- system(MBTK_BOOT_SERVER_READY);
+ mbtk_system(MBTK_BOOT_SERVER_READY);
} else {
LOGE("%s can not exec.", MBTK_BOOT_SERVER_READY);
}
@@ -290,7 +292,7 @@
}
}
-static void ril_state_change(ril_msg_id_enum msg_id, void *data, int data_len)
+static void ril_state_change(ril_msg_id_enum msg_id, const void *data, int data_len)
{
sock_cli_info_t *cli = NULL;
list_first(ril_info.sock_client_list);
@@ -679,6 +681,11 @@
state.tech = (mbtk_radio_technology_enum)tmp_int; // AcT
}
+ if(state.reg_state == MBTK_NET_REG_STATE_HOME
+ || state.reg_state == MBTK_NET_REG_STATE_ROAMING) {
+ mbtk_net_ready();
+ }
+
urc_msg_distribute(false, RIL_MSG_ID_IND_NET_REG_STATE_CHANGE, &state, sizeof(mbtk_ril_net_reg_state_info_t));
CGREG_EXIT:
free(tmp_s);
@@ -749,21 +756,30 @@
// "+CGEV: ME PDN ACT ")) { // +CGEV: ME PDN ACT <cid>,1
mbtk_ril_pdp_state_info_t cgev_info;
memset(&cgev_info, 0, sizeof(mbtk_ril_pdp_state_info_t));
- if (sscanf(s, "+CGEV: NW PDN DEACT %d", &(cgev_info.cid)) == 1) {
+ int cid, reason = 0;
+ memset(&cgev_info, 0, sizeof(mbtk_ril_pdp_state_info_t));
+ if (sscanf(s, "+CGEV: NW PDN DEACT %d", &cid) == 1) {
+ cgev_info.cid = (uint16)cid;
cgev_info.action = FALSE;
- } else if (sscanf(s, "+CGEV: ME PDN DEACT %d", &(cgev_info.cid)) == 1) {
+ } else if (sscanf(s, "+CGEV: ME PDN DEACT %d", &cid) == 1) {
+ cgev_info.cid = (uint16)cid;
cgev_info.action = FALSE;
- } else if(sscanf(s, "+CGEV: ME PDN ACT %d,%d", &(cgev_info.cid), &(cgev_info.reason)) == 2
- || sscanf(s, "+CGEV: ME PDN ACT %d", &(cgev_info.cid)) == 1) {
+ } else if(sscanf(s, "+CGEV: ME PDN ACT %d,%d", &cid, &reason) == 2
+ || sscanf(s, "+CGEV: ME PDN ACT %d", &cid) == 1) {
+ cgev_info.cid = (uint16)cid;
+ cgev_info.reason = (uint16)reason;
cgev_info.action = TRUE;
} else if (!strcmp(s, "+CGEV: ME DETACH")) {
if(cgact_wait.waitting) {
cgev_info.cid = cgact_wait.cid;
}
cgev_info.action = FALSE;
- } else if (sscanf(s, "+CGEV: NW MODIFY %d,%d", &(cgev_info.cid), &(cgev_info.reason)) == 2) {
+ } else if (sscanf(s, "+CGEV: NW MODIFY %d,%d", &cid, &reason) == 2) {
+ cgev_info.cid = (uint16)cid;
+ cgev_info.reason = (uint16)reason;
cgev_info.action = TRUE;
- } else if(sscanf(s, "+CGEV: EPS PDN ACT %d", &(cgev_info.cid)) == 1) {
+ } else if(sscanf(s, "+CGEV: EPS PDN ACT %d", &cid) == 1) {
+ cgev_info.cid = (uint16)cid;
cgev_info.action = TRUE;
} else {
LOGD(">>>>>>>>>No process +CGEV <<<<<<<<<");
@@ -2400,7 +2416,7 @@
band_info.band_support.lte_ext_band = info_modem.band_lte_ext;
}
- bool is_first = TRUE;
+// bool is_first = TRUE;
while(!band_info.band_set_success) {
// Set band.
#if 0
@@ -2500,7 +2516,7 @@
pthread_mutex_init(&ril_info.msg_mutex, NULL);
pthread_cond_init(&ril_info.msg_cond, NULL);
- pthread_t info_pid, pack_pid, monitor_pid, urc_pid, bootconn_pid;
+ pthread_t info_pid, pack_pid/*, monitor_pid, urc_pid, bootconn_pid*/;
pthread_attr_t thread_attr;
pthread_attr_init(&thread_attr);
if(pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED))