From ec84c9f488c5918cfce8bfe739d3297542ce96ff Mon Sep 17 00:00:00 2001 From: Dane Wagner Date: Fri, 27 Mar 2026 16:53:50 -0500 Subject: [PATCH] Fix a few uninitialized mutexes --- src/core/logger.c | 1 + src/core/logger_json.c | 1 + src/database/db_core.c | 2 +- src/storage/storage_manager_streams_cache.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/logger.c b/src/core/logger.c index 6720b4af..266ef5ca 100644 --- a/src/core/logger.c +++ b/src/core/logger.c @@ -34,6 +34,7 @@ static struct { .log_level = LOG_LEVEL_INFO, .console_logging = 1, .log_filename = "", + .mutex = PTHREAD_MUTEX_INITIALIZER, .syslog_enabled = 0, .syslog_ident = "", .shutdown = 0, diff --git a/src/core/logger_json.c b/src/core/logger_json.c index 7ab8359b..9975cb30 100644 --- a/src/core/logger_json.c +++ b/src/core/logger_json.c @@ -23,6 +23,7 @@ static struct { } json_logger = { .log_file = NULL, .log_filename = "", + .mutex = PTHREAD_MUTEX_INITIALIZER, .initialized = 0 }; diff --git a/src/database/db_core.c b/src/database/db_core.c index 97332ec6..cdfab9ef 100644 --- a/src/database/db_core.c +++ b/src/database/db_core.c @@ -31,7 +31,7 @@ static sqlite3 *db = NULL; // Mutex for thread safety -static pthread_mutex_t db_mutex; +static pthread_mutex_t db_mutex = PTHREAD_MUTEX_INITIALIZER; // Database path for backup/recovery operations static char db_file_path[1024] = {0}; diff --git a/src/storage/storage_manager_streams_cache.c b/src/storage/storage_manager_streams_cache.c index 5ce0fd77..c51d0302 100644 --- a/src/storage/storage_manager_streams_cache.c +++ b/src/storage/storage_manager_streams_cache.c @@ -38,6 +38,7 @@ static stream_storage_cache_t cache = { .stream_count = 0, .last_update = 0, .ttl_seconds = 1800, // Default TTL: 30 minutes + .mutex = PTHREAD_MUTEX_INITIALIZER, .initialized = 0 };