naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
ecbff1
From 10a1adc237ada061f557a7ae422456aa7d8c2c05 Mon Sep 17 00:00:00 2001
ecbff1
From: Jan Synacek <jsynacek@redhat.com>
ecbff1
Date: Thu, 7 Sep 2017 14:41:09 +0200
ecbff1
Subject: [PATCH] Redefine 32bit time_t format to signed
ecbff1
MIME-Version: 1.0
ecbff1
Content-Type: text/plain; charset=UTF-8
ecbff1
Content-Transfer-Encoding: 8bit
ecbff1
ecbff1
It seems that it is signed both on i386 and arm.
ecbff1
ecbff1
Avoids a stupid gcc warning on arm:
ecbff1
ecbff1
src/udev/udevadm-monitor.c: In function ‘print_device’:
ecbff1
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=]
ecbff1
         printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n",
ecbff1
                ^
ecbff1
ecbff1
(cherry picked from commit 6307c39b94344b901c1d6e0df7ee58644a8809bf)
ecbff1
ecbff1
Related: #1447937
ecbff1
---
ecbff1
 src/shared/util.h | 2 +-
ecbff1
 1 file changed, 1 insertion(+), 1 deletion(-)
ecbff1
ecbff1
diff --git a/src/shared/util.h b/src/shared/util.h
ecbff1
index f1b6c348f..80ad18c0a 100644
ecbff1
--- a/src/shared/util.h
ecbff1
+++ b/src/shared/util.h
ecbff1
@@ -72,7 +72,7 @@
ecbff1
 #if SIZEOF_TIME_T == 8
ecbff1
 #  define PRI_TIME PRIi64
ecbff1
 #elif SIZEOF_TIME_T == 4
ecbff1
-#  define PRI_TIME PRIu32
ecbff1
+#  define PRI_TIME "li"
ecbff1
 #else
ecbff1
 #  error Unknown time_t size
ecbff1
 #endif