]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck: initialize timevals [-Werror=maybe-uninitialized]
authorKarel Zak <kzak@redhat.com>
Thu, 18 Jan 2024 19:43:51 +0000 (20:43 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 18 Jan 2024 19:43:51 +0000 (20:43 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fsck.c
lib/monotonic.c

index 2a54dc5d1cff052c5fec7dc66354f329c8be5804..c63ce1c23ac534faadde9caf08a8a75e6892cbf6 100644 (file)
@@ -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;
index cd554dd7193374df34ce33a718a062d1b3784153..63feec0fbd24d6aa8692f276c313b2724690dc21 100644 (file)
 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