anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0509-Redefine-32bit-time_t-format-to-signed.patch

dd65c9
From 10a1adc237ada061f557a7ae422456aa7d8c2c05 Mon Sep 17 00:00:00 2001
dd65c9
From: Jan Synacek <jsynacek@redhat.com>
dd65c9
Date: Thu, 7 Sep 2017 14:41:09 +0200
dd65c9
Subject: [PATCH] Redefine 32bit time_t format to signed
dd65c9
MIME-Version: 1.0
dd65c9
Content-Type: text/plain; charset=UTF-8
dd65c9
Content-Transfer-Encoding: 8bit
dd65c9
dd65c9
It seems that it is signed both on i386 and arm.
dd65c9
dd65c9
Avoids a stupid gcc warning on arm:
dd65c9
dd65c9
src/udev/udevadm-monitor.c: In function ‘print_device’:
dd65c9
src/udev/udevadm-monitor.c:44:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘__time_t {aka long int}’ [-Wformat=]
dd65c9
         printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n",
dd65c9
                ^
dd65c9
dd65c9
(cherry picked from commit 6307c39b94344b901c1d6e0df7ee58644a8809bf)
dd65c9
dd65c9
Related: #1447937
dd65c9
---
dd65c9
 src/shared/util.h | 2 +-
dd65c9
 1 file changed, 1 insertion(+), 1 deletion(-)
dd65c9
dd65c9
diff --git a/src/shared/util.h b/src/shared/util.h
c62b8e
index f1b6c348f8..80ad18c0ad 100644
dd65c9
--- a/src/shared/util.h
dd65c9
+++ b/src/shared/util.h
dd65c9
@@ -72,7 +72,7 @@
dd65c9
 #if SIZEOF_TIME_T == 8
dd65c9
 #  define PRI_TIME PRIi64
dd65c9
 #elif SIZEOF_TIME_T == 4
dd65c9
-#  define PRI_TIME PRIu32
dd65c9
+#  define PRI_TIME "li"
dd65c9
 #else
dd65c9
 #  error Unknown time_t size
dd65c9
 #endif