From 5e4cf9e7547b4211cc6a9dbf160af01bffea0261 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 18 Jan 2024 20:43:51 +0100 Subject: [PATCH] fsck: initialize timevals [-Werror=maybe-uninitialized] Signed-off-by: Karel Zak --- disk-utils/fsck.c | 2 +- lib/monotonic.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c index 2a54dc5d1c..c63ce1c23a 100644 --- a/disk-utils/fsck.c +++ b/disk-utils/fsck.c @@ -594,7 +594,7 @@ static int progress_active(void) */ static void print_stats(struct fsck_instance *inst) { - struct timeval delta; + struct timeval delta = { 0 }; if (!inst || !report_stats || noexecute) return; diff --git a/lib/monotonic.c b/lib/monotonic.c index cd554dd719..63feec0fbd 100644 --- a/lib/monotonic.c +++ b/lib/monotonic.c @@ -18,10 +18,10 @@ int get_boot_time(struct timeval *boot_time) { #ifdef CLOCK_BOOTTIME - struct timespec hires_uptime; - struct timeval lores_uptime; + struct timespec hires_uptime = { 0 }; + struct timeval lores_uptime = { 0 }; #endif - struct timeval now; + struct timeval now = { 0 }; #ifdef HAVE_SYSINFO struct sysinfo info; #endif -- 2.47.3