From 543bac908e5ad6d14ef1be3b5e1fdd0ed2b3f844 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 12 Feb 2021 12:05:43 -0500 Subject: [PATCH] TT#106253 cleanup TLS variables on shutdown Change-Id: I77f88e6a34e4720f6fbd0c585d2cf9843a3b309e --- recording-daemon/db.c | 4 ++++ recording-daemon/db.h | 1 + recording-daemon/epoll.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/recording-daemon/db.c b/recording-daemon/db.c index 341fd9a00..61e1d8c96 100644 --- a/recording-daemon/db.c +++ b/recording-daemon/db.c @@ -451,3 +451,7 @@ void db_config_stream(output_t *op) { execute_wrap(&stm_config_stream, b, NULL); } + +void db_thread_end(void) { + reset_conn(); +} diff --git a/recording-daemon/db.h b/recording-daemon/db.h index 82a4a1735..8032bfa82 100644 --- a/recording-daemon/db.h +++ b/recording-daemon/db.h @@ -10,6 +10,7 @@ void db_do_stream(metafile_t *mf, output_t *op, const char *type, stream_t *, un void db_close_stream(output_t *op); void db_delete_stream(output_t *op); void db_config_stream(output_t *op); +void db_thread_end(void); #endif diff --git a/recording-daemon/epoll.c b/recording-daemon/epoll.c index 68e86b9ba..c679717d7 100644 --- a/recording-daemon/epoll.c +++ b/recording-daemon/epoll.c @@ -7,6 +7,7 @@ #include "log.h" #include "main.h" #include "garbage.h" +#include "db.h" static int epoll_fd = -1; @@ -34,6 +35,7 @@ void epoll_del(int fd) { static void poller_thread_end(void *ptr) { mysql_thread_end(); + db_thread_end(); }