From 5818ff0dc11b4f058931392b0deac57089403b3f Mon Sep 17 00:00:00 2001 From: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:49:44 +0200 Subject: [PATCH] Remove duplicate check (#16936) --- src/libnetdata/log/log.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/libnetdata/log/log.c b/src/libnetdata/log/log.c index d50bca55b46753..e7edd5c5244afa 100644 --- a/src/libnetdata/log/log.c +++ b/src/libnetdata/log/log.c @@ -2162,13 +2162,11 @@ static void nd_logger(const char *file, const char *function, const unsigned lon char os_threadname[NETDATA_THREAD_NAME_MAX + 1]; if(likely(!thread_log_fields[NDF_THREAD_TAG].entry.set)) { const char *thread_tag = netdata_thread_tag(); - if(!netdata_thread_tag_exists()) { - if (!netdata_thread_tag_exists()) { - os_thread_get_current_name_np(os_threadname); - if ('\0' != os_threadname[0]) - /* If it is not an empty string replace "MAIN" thread_tag */ - thread_tag = os_threadname; - } + if (!netdata_thread_tag_exists()) { + os_thread_get_current_name_np(os_threadname); + if ('\0' != os_threadname[0]) + /* If it is not an empty string replace "MAIN" thread_tag */ + thread_tag = os_threadname; } thread_log_fields[NDF_THREAD_TAG].entry = ND_LOG_FIELD_TXT(NDF_THREAD_TAG, thread_tag); @@ -2311,13 +2309,11 @@ void netdata_logger_fatal( const char *file, const char *function, const unsigne char os_threadname[NETDATA_THREAD_NAME_MAX + 1]; const char *thread_tag = netdata_thread_tag(); - if(!netdata_thread_tag_exists()) { - if (!netdata_thread_tag_exists()) { - os_thread_get_current_name_np(os_threadname); - if ('\0' != os_threadname[0]) - /* If it is not an empty string replace "MAIN" thread_tag */ - thread_tag = os_threadname; - } + if (!netdata_thread_tag_exists()) { + os_thread_get_current_name_np(os_threadname); + if ('\0' != os_threadname[0]) + /* If it is not an empty string replace "MAIN" thread_tag */ + thread_tag = os_threadname; } if(!thread_tag) thread_tag = "UNKNOWN";