From b829d3c9f759d46feef72a16c4bfa6849e5e0e84 Mon Sep 17 00:00:00 2001
From: laurent <laurent.thomas@open-cells.com>
Date: Fri, 31 Jul 2020 16:04:24 +0200
Subject: [PATCH] add exit trace and fix a gcc warning

---
 executables/main-fs6.c      | 2 +-
 executables/main-ocp.c      | 2 ++
 executables/split_headers.h | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/executables/main-fs6.c b/executables/main-fs6.c
index ffa44bd9787..d2d64d09593 100644
--- a/executables/main-fs6.c
+++ b/executables/main-fs6.c
@@ -401,7 +401,7 @@ void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_
   hULUE(newUDPheader)->O_ACK=eNB->ulsch[UE_id]->harq_processes[harq_pid]->O_ACK;
   memcpy(hULUE(newUDPheader)->o_ACK, eNB->ulsch[UE_id]->harq_processes[harq_pid]->o_ACK,
          sizeof(eNB->ulsch[UE_id]->harq_processes[harq_pid]->o_ACK));
-  hULUE(newUDPheader)->ta=lte_est_timing_advance_pusch(eNB, UE_id);
+  hULUE(newUDPheader)->ta=lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[UE_id]->drs_ch_estimates_time);
   hULUE(newUDPheader)->segment=segmentID;
   memcpy(hULUE(newUDPheader)->o, eNB->ulsch[UE_id]->harq_processes[harq_pid]->o,
          sizeof(eNB->ulsch[UE_id]->harq_processes[harq_pid]->o));
diff --git a/executables/main-ocp.c b/executables/main-ocp.c
index e4e42b4f23b..204067b229a 100644
--- a/executables/main-ocp.c
+++ b/executables/main-ocp.c
@@ -97,6 +97,7 @@ void exit_function(const char *file, const char *function, const int line, const
   if (s != NULL) {
     printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s);
   }
+  softmodem_printresources(0,(telnet_printfunc_t)printf);
 
   close_log_mem();
   oai_exit = 1;
@@ -1167,6 +1168,7 @@ int main ( int argc, char **argv ) {
   T_Config_Init();
 #endif
   configure_linux();
+  set_softmodem_sighandler();
   cpuf=get_cpu_freq_GHz();
   set_taus_seed (0);
 
diff --git a/executables/split_headers.h b/executables/split_headers.h
index 4e328f74c41..985b1b7daeb 100644
--- a/executables/split_headers.h
+++ b/executables/split_headers.h
@@ -28,6 +28,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <openair1/PHY/defs_eNB.h>
+#include <common/utils/telnetsrv/telnetsrv_proccmd.h>
 
 #define CU_PORT "7878"
 #define DU_PORT "8787"
@@ -325,5 +326,6 @@ void fep_full(RU_t *ru, int subframe);
 void feptx_prec(RU_t *ru,int frame,int subframe);
 void feptx_ofdm(RU_t *ru, int frame, int subframe);
 void oai_subframe_ind(uint16_t sfn, uint16_t sf);
+void softmodem_printresources(int sig, telnet_printfunc_t pf);
 extern uint16_t sf_ahead;
 #endif
-- 
GitLab