Blame SOURCES/008-fencing-history.patch

0aa0b6
From 0339e89f3238b31df78b864dae8684b82c370741 Mon Sep 17 00:00:00 2001
0aa0b6
From: Ken Gaillot <kgaillot@redhat.com>
0aa0b6
Date: Mon, 13 Dec 2021 15:22:40 -0600
0aa0b6
Subject: [PATCH] Fix: fencer: get current time correctly
0aa0b6
0aa0b6
f52bc8e1ce (2.1.2) introduced a regression by using clock_gettime() with
0aa0b6
CLOCK_MONOTONIC to get the current time. Use qb_util_timespec_from_epoch_get()
0aa0b6
instead (which as of this writing uses clock_gettime() with CLOCK_REALTIME if
0aa0b6
available, and falls back to gettimeofday() if not).
0aa0b6
---
0aa0b6
 daemons/fenced/fenced_commands.c | 11 +++--------
0aa0b6
 1 file changed, 3 insertions(+), 8 deletions(-)
0aa0b6
0aa0b6
diff --git a/daemons/fenced/fenced_commands.c b/daemons/fenced/fenced_commands.c
0aa0b6
index f34cb4f13..7685cb8c3 100644
0aa0b6
--- a/daemons/fenced/fenced_commands.c
0aa0b6
+++ b/daemons/fenced/fenced_commands.c
0aa0b6
@@ -2746,19 +2746,14 @@ bool fencing_peer_active(crm_node_t *peer)
0aa0b6
     return FALSE;
0aa0b6
 }
0aa0b6
 
0aa0b6
-void set_fencing_completed(remote_fencing_op_t * op)
0aa0b6
+void
0aa0b6
+set_fencing_completed(remote_fencing_op_t *op)
0aa0b6
 {
0aa0b6
-#ifdef CLOCK_MONOTONIC
0aa0b6
     struct timespec tv;
0aa0b6
 
0aa0b6
-    clock_gettime(CLOCK_MONOTONIC, &tv;;
0aa0b6
-
0aa0b6
+    qb_util_timespec_from_epoch_get(&tv;;
0aa0b6
     op->completed = tv.tv_sec;
0aa0b6
     op->completed_nsec = tv.tv_nsec;
0aa0b6
-#else
0aa0b6
-    op->completed = time(NULL);
0aa0b6
-    op->completed_nsec = 0L;
0aa0b6
-#endif
0aa0b6
 }
0aa0b6
 
0aa0b6
 /*!
0aa0b6
-- 
0aa0b6
2.27.0
0aa0b6