systemd/0189-Fix-inversion-of-timesyncd_usec-epoch_usec-variables.patch
Jan Macku e0b00a8ea2 systemd-257-7
Resolves: RHEL-71409
2025-02-10 08:20:10 +01:00

34 lines
1.5 KiB
Diff

From f1c2574578e655a15367875548d4f3b8312fe1f6 Mon Sep 17 00:00:00 2001
From: Devilish Spirits <devilishspirits@gmail.com>
Date: Wed, 29 Jan 2025 21:54:27 +0100
Subject: [PATCH] Fix inversion of timesyncd_usec/epoch_usec variables in
clock-warp.c
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.
(cherry picked from commit 164295eb6dcc0271d7de030809732c23eeccf9f0)
---
src/core/clock-warp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/clock-warp.c b/src/core/clock-warp.c
index 49d57afa9a..ceaf4b3926 100644
--- a/src/core/clock-warp.c
+++ b/src/core/clock-warp.c
@@ -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);