summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--VNFs/DPPD-PROX/display.c1
-rw-r--r--VNFs/DPPD-PROX/log.c7
-rw-r--r--VNFs/DPPD-PROX/log.h1
-rw-r--r--VNFs/DPPD-PROX/quit.h2
4 files changed, 11 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/display.c b/VNFs/DPPD-PROX/display.c
index e1b8d8d2..d81a40e4 100644
--- a/VNFs/DPPD-PROX/display.c
+++ b/VNFs/DPPD-PROX/display.c
@@ -669,6 +669,7 @@ void display_end(void)
if (scr != NULL) {
endwin();
}
+ scr = NULL;
}
static void pps_print(WINDOW *dst_scr, int y, int x, uint64_t val, int is_blue)
diff --git a/VNFs/DPPD-PROX/log.c b/VNFs/DPPD-PROX/log.c
index b07076de..2094c185 100644
--- a/VNFs/DPPD-PROX/log.c
+++ b/VNFs/DPPD-PROX/log.c
@@ -81,6 +81,13 @@ void plog_init(const char *log_name, int log_name_pid)
tsc_off = rte_rdtsc() + 2500000000;
}
+void plog_end(void)
+{
+ if (fp)
+ fclose(fp);
+ fp = NULL;
+}
+
int plog_set_lvl(int lvl)
{
if (lvl <= PROX_MAX_LOG_LVL) {
diff --git a/VNFs/DPPD-PROX/log.h b/VNFs/DPPD-PROX/log.h
index a5dcf47a..0d2fba18 100644
--- a/VNFs/DPPD-PROX/log.h
+++ b/VNFs/DPPD-PROX/log.h
@@ -81,6 +81,7 @@ __attribute__((format(printf, 2, 3))) static inline int plogdx_dbg(__attribute__
#endif
void plog_init(const char *log_name, int log_name_pid);
+void plog_end(void);
void file_print(const char *str);
int plog_set_lvl(int lvl);
diff --git a/VNFs/DPPD-PROX/quit.h b/VNFs/DPPD-PROX/quit.h
index d0bf8b95..c3cd0569 100644
--- a/VNFs/DPPD-PROX/quit.h
+++ b/VNFs/DPPD-PROX/quit.h
@@ -34,6 +34,8 @@
if (cond) { \
plog_info(__VA_ARGS__); \
display_end(); \
+ plog_end(); \
+ plog_info(__VA_ARGS__); \
if (prox_cfg.flags & DSF_DAEMON) { \
pid_t ppid = getppid(); \
plog_info("sending SIGUSR2 to %d\n", ppid);\