diff mbox series

[meta-networking] open-vm-tools: Fix build with 64-bit time_t

Message ID 20230103214358.110410-1-raj.khem@gmail.com
State New
Headers show
Series [meta-networking] open-vm-tools: Fix build with 64-bit time_t | expand

Commit Message

Khem Raj Jan. 3, 2023, 9:43 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...c-Portable-way-to-print-64bit-time_t.patch | 41 +++++++++++++++++++
 .../open-vm-tools/open-vm-tools_12.1.5.bb     |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-timeSync-Portable-way-to-print-64bit-time_t.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-timeSync-Portable-way-to-print-64bit-time_t.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-timeSync-Portable-way-to-print-64bit-time_t.patch
new file mode 100644
index 0000000000..1b6f8d707e
--- /dev/null
+++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-timeSync-Portable-way-to-print-64bit-time_t.patch
@@ -0,0 +1,41 @@ 
+From 5ff35f0093133cfe33747995f9a4a09090eee171 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 3 Jan 2023 13:36:01 -0800
+Subject: [PATCH] timeSync: Portable way to print 64bit time_t
+
+This ensures when 64bit time_t is used on 32bit architectures (
+-D_TIME_BITS=64 ) then it can print it correctly as well.
+
+Fixes
+pllLinux.c:43:20: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat]
+|            prefix, tx->offset, tx->freq, tx->maxerror, tx->esterror,
+|                    ^~~~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/631]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ open-vm-tools/services/plugins/timeSync/pllLinux.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/open-vm-tools/services/plugins/timeSync/pllLinux.c b/open-vm-tools/services/plugins/timeSync/pllLinux.c
+index e9c8e61de..90ba8c63f 100644
+--- a/open-vm-tools/services/plugins/timeSync/pllLinux.c
++++ b/open-vm-tools/services/plugins/timeSync/pllLinux.c
+@@ -38,10 +38,10 @@
+ static void
+ TimeSyncLogPLLState(const char *prefix, struct timex *tx)
+ {
+-   g_debug("%s : off %ld freq %ld maxerr %ld esterr %ld status %d "
+-           "const %ld precision %ld tolerance %ld tick %ld\n",
+-           prefix, tx->offset, tx->freq, tx->maxerror, tx->esterror, 
+-           tx->status, tx->constant, tx->precision, tx->tolerance, tx->tick);
++   g_debug("%s : off %jd freq %jd maxerr %jd esterr %jd status %d "
++           "const %jd precision %jd tolerance %jd tick %jd\n",
++           prefix, (intmax_t)tx->offset, (intmax_t)tx->freq, (intmax_t)tx->maxerror, (intmax_t)tx->esterror, 
++           tx->status, (intmax_t)tx->constant, (intmax_t)tx->precision, (intmax_t)tx->tolerance, (intmax_t)tx->tick);
+ }
+ 
+ /*
+-- 
+2.39.0
+
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_12.1.5.bb b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_12.1.5.bb
index 93d3d59eb2..d389d2450c 100644
--- a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_12.1.5.bb
+++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_12.1.5.bb
@@ -42,6 +42,7 @@  SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https;branch=stabl
            file://0011-Use-off64_t-instead-of-__off64_t.patch;patchdir=.. \
            file://0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \
            file://0013-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \
+           file://0001-timeSync-Portable-way-to-print-64bit-time_t.patch;patchdir=.. \
            "
 
 UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)"