]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Fix inversion of timesyncd_usec/epoch_usec variables in clock-warp.c
authorDevilish Spirits <devilishspirits@gmail.com>
Wed, 29 Jan 2025 20:54:27 +0000 (21:54 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 30 Jan 2025 08:27:03 +0000 (09:27 +0100)
In clock_apply_epoch() function, the /usr/lib/clock-epoch timestamp was set to timesyncd_usec instead of epoch_usec and vice-versa which produced a misleading log message about the clock source systemd used for early clock sanitization. This trivial commit fix the mistake.

src/core/clock-warp.c

index 49d57afa9a66e72d809a865e35747b4bd7e0f273..ceaf4b392671749bb0ab9ea0ec879f59d1cdaf7f 100644 (file)
@@ -27,13 +27,13 @@ void clock_apply_epoch(bool allow_backwards) {
 
         r = RET_NERRNO(stat(TIMESYNCD_CLOCK_FILE, &st));
         if (r >= 0)
-                epoch_usec = timespec_load(&st.st_mtim);
+                timesyncd_usec = timespec_load(&st.st_mtim);
         else if (r != -ENOENT)
                 log_warning_errno(r, "Could not stat %s, ignoring: %m", TIMESYNCD_CLOCK_FILE);
 
         r = RET_NERRNO(stat(EPOCH_CLOCK_FILE, &st));
         if (r >= 0)
-                timesyncd_usec = timespec_load(&st.st_mtim);
+                epoch_usec = timespec_load(&st.st_mtim);
         else if (r != -ENOENT)
                 log_warning_errno(r, "Could not stat %s, ignoring: %m", EPOCH_CLOCK_FILE);