diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index 2fc036bdf5fbe043df47d46ec5b2702a99bbc02f..5b15f6e4f87078f0cfd1e93e5a2b19b6bdd13585 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -166,7 +166,8 @@ typedef struct itti_desc_s { task_id_t task_max; MessagesIds messages_id_max; - pthread_t thread_handling_signals; + boolean_t thread_handling_signals; + pthread_t thread_ref; const task_info_t *tasks_info; const message_info_t *messages_info; @@ -791,8 +792,8 @@ void itti_terminate_tasks(task_id_t task_id) { // Sends Terminate signals to all tasks. itti_send_terminate_message (task_id); - if (itti_desc.thread_handling_signals >= 0) { - pthread_kill (itti_desc.thread_handling_signals, SIGUSR1); + if (itti_desc.thread_handling_signals) { + pthread_kill (itti_desc.thread_ref, SIGUSR1); } pthread_exit (NULL); @@ -856,7 +857,7 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i itti_desc.task_max = task_max; itti_desc.thread_max = thread_max; itti_desc.messages_id_max = messages_id_max; - itti_desc.thread_handling_signals = -1; + itti_desc.thread_handling_signals = FALSE; itti_desc.tasks_info = tasks_info; itti_desc.messages_info = messages_info; @@ -975,7 +976,8 @@ void itti_wait_tasks_end(void) { int result; int retries = 10; - itti_desc.thread_handling_signals = pthread_self (); + itti_desc.thread_handling_signals = TRUE; + itti_desc.thread_ref=pthread_self (); /* Handle signals here */ while (end == 0) { diff --git a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c index 67e4e3bd3469b989924d010f9235a945e99614f3..0ee4e0a8443a60a24af33a8ded9e6c970aef09c1 100644 --- a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c @@ -362,7 +362,7 @@ NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz, "Tunnel already exists", teid); rc = nwGtpTunnelEndPointDestroy(thiz, pTunnelEndPoint); NW_ASSERT(rc == NW_GTPV1U_OK); - *phStackSession = (NwGtpv1uStackSessionHandleT) 0; + *phStackSession = (NwGtpv1uStackSessionHandleT) NULL; NW_ASSERT(0); rc = NW_GTPV1U_FAILURE; } else { diff --git a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c index bfc48bd6ea02c575659dd7c36a67427fc6f2bee5..021042d24e1e008d94974fea3a65859255b52157 100644 --- a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c +++ b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c @@ -495,8 +495,8 @@ nwGtpv1uMsgHexDump(NwGtpv1uMsgHandleT hMsg, FILE *fp) for(n=1; n<=size; n++) { if (n%16 == 1) { /* store address for this line */ - snprintf(addrstr, sizeof(addrstr), "%.4x", - ((unsigned int)p-(unsigned int)data) ); + snprintf(addrstr, sizeof(addrstr), "%.4lx", + (p-data) ); } c = *p; diff --git a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c index d4116b6217c70491b0a974a10d95afee1d3906cf..0f90acd715d12e7d96eec397ffbc7278c6d9fa9d 100644 --- a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c +++ b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c @@ -92,8 +92,8 @@ nwGtpv1uTrxnPeerRspTimeout(void *arg) NW_ASSERT(pStack); - NW_LOG(pStack, NW_LOG_LEVEL_WARN, "T3 timer expired for transaction 0x%x", - (unsigned int)thiz); + NW_LOG(pStack, NW_LOG_LEVEL_WARN, "T3 timer expired for transaction 0x%p", + thiz); rc = nwGtpv1uTrxnSendMsgRetransmission(thiz); @@ -213,7 +213,7 @@ nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT *thiz, rc = NW_GTPV1U_FAILURE; } - NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%X", (unsigned int)pTrxn); + NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn); *ppTrxn = pTrxn; @@ -254,7 +254,7 @@ nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT *thiz, rc = NW_GTPV1U_FAILURE; } - NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%X", (unsigned int)pTrxn); + NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn); *ppTrxn = pTrxn; @@ -290,7 +290,7 @@ nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz) thiz->next = gpGtpv1uTrxnPool; gpGtpv1uTrxnPool = thiz; - NW_LOG(pStack, NW_LOG_LEVEL_DEBG, "Purged transaction 0x%X", (unsigned int)thiz); + NW_LOG(pStack, NW_LOG_LEVEL_DEBG, "Purged transaction 0x%p", thiz); *pthiz = NULL; return rc;