Blame SOURCES/008-fencing-history.patch

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