File pacemaker#3407-0001-Log-fencer-always-format-time_t-values-as-long-long.patch of Package pacemaker.36873

From 6a882fe8c09c8173e69c2951d294f239ead91b2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ferenc=20W=C3=A1gner?= <wferi@debian.org>
Date: Fri, 22 Mar 2024 16:40:07 +0100
Subject: [PATCH] Log: fencer: always format time_t values as long long
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Conventionally it's signed long under the GNU C library, which is 32
bits on 32-bit architectures, but Glibc provides the __TIME_BITS==64
option, which makes it signed long long instead (64 bits) and makes no
difference on 64-bit architectures [1].  This enables using the %lld
conversion specifier uniformly across all supported architectures.
This got exposed by Debian recently transitioning to 64-bit time_t [2].

[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
[2] https://wiki.debian.org/ReleaseGoals/64bit-time

Signed-off-by: Ferenc Wágner <wferi@debian.org>
---
 daemons/fenced/fenced_remote.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: pacemaker-2.0.5+20201202.ba59be712/daemons/fenced/fenced_remote.c
===================================================================
--- pacemaker-2.0.5+20201202.ba59be712.orig/daemons/fenced/fenced_remote.c
+++ pacemaker-2.0.5+20201202.ba59be712/daemons/fenced/fenced_remote.c
@@ -922,9 +922,9 @@ merge_duplicates(remote_fencing_op_t * o
 
         } else if(other->total_timeout > 0 && now > (other->total_timeout + other->created)) {
             crm_info("Action '%s' targeting %s originating from client "
-                     "%s@%s.%.8s is too old: %ld vs. %ld + %d",
+                     "%s@%s.%.8s is too old: %lld vs. %lld + %ds",
                      other->action, other->target, other->client_name, other->originator, other->id,
-                     now, other->created, other->total_timeout);
+                     (long long)now, (long long)other->created, other->total_timeout);
             continue;
         }
 
openSUSE Build Service is sponsored by