summaryrefslogtreecommitdiff
path: root/user/rrdtool/time64.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-12-10 23:17:35 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-12-10 23:17:35 +0000
commitcc4460cc197ddc5bf2a3695f21ed29ebfc4fb62a (patch)
tree367ed67363690e65b70b81c8ca0514fdb3d1d9c2 /user/rrdtool/time64.patch
parent9a6e4b7f4c99f1ee943fbf609527f4bb6196fc3c (diff)
downloadpackages-cc4460cc197ddc5bf2a3695f21ed29ebfc4fb62a.tar.gz
packages-cc4460cc197ddc5bf2a3695f21ed29ebfc4fb62a.tar.bz2
packages-cc4460cc197ddc5bf2a3695f21ed29ebfc4fb62a.tar.xz
packages-cc4460cc197ddc5bf2a3695f21ed29ebfc4fb62a.zip
user/rrdtool: Fix time64 issue on 32-bit systems
This only showed up in tests on ppc, but would eventually hit all of them. The code already correctly handled SIZEOF_TIME_T being 8, but this was cased on _WIN32. Removed that specialisation and now it works. Fixes: #877
Diffstat (limited to 'user/rrdtool/time64.patch')
-rw-r--r--user/rrdtool/time64.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/user/rrdtool/time64.patch b/user/rrdtool/time64.patch
new file mode 100644
index 000000000..5f5eea43e
--- /dev/null
+++ b/user/rrdtool/time64.patch
@@ -0,0 +1,51 @@
+--- rrdtool-1.8.0/src/rrd_graph_helper.c.old 2022-03-14 14:30:12.000000000 +0000
++++ rrdtool-1.8.0/src/rrd_graph_helper.c 2022-12-10 23:14:10.132482183 +0000
+@@ -1901,7 +1901,7 @@
+ dprintf("SHIFTBY : %s (%i)\n", im->gdes[gdp->shidx].vname,
+ gdp->shidx);
+ } else {
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ dprintf("SHIFTBY : %lli\n", gdp->shval); /* argument 3 has type 'time_t {aka long long int}' */
+ #else
+ dprintf("SHIFTBY : %li\n", gdp->shval);
+--- rrdtool-1.8.0/src/rrd_lastupdate.c.old 2022-03-14 14:30:12.000000000 +0000
++++ rrdtool-1.8.0/src/rrd_lastupdate.c 2022-12-10 23:14:48.138375888 +0000
+@@ -77,7 +77,7 @@
+ printf(" %s", ds_names[i]);
+ printf ("\n\n");
+
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf ("%10llu:", last_update); /* argument 2 has type 'time_t {aka long long int} */
+ #else
+ printf ("%10lu:", last_update);
+--- rrdtool-1.8.0/src/rrd_tool.c.old 2022-03-14 14:30:12.000000000 +0000
++++ rrdtool-1.8.0/src/rrd_tool.c 2022-12-10 23:14:38.579408674 +0000
+@@ -723,7 +723,7 @@
+ else if (strcmp("resize", argv[1]) == 0)
+ rrd_resize(argc - 1, &argv[1]);
+ else if (strcmp("last", argv[1]) == 0)
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf("%lld\n", rrd_last(argc - 1, &argv[1]));
+ #else
+ printf("%ld\n", rrd_last(argc - 1, &argv[1]));
+@@ -731,7 +731,7 @@
+ else if (strcmp("lastupdate", argv[1]) == 0) {
+ rrd_lastupdate(argc - 1, &argv[1]);
+ } else if (strcmp("first", argv[1]) == 0)
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf("%lld\n", rrd_first(argc - 1, &argv[1]));
+ #else
+ printf("%ld\n", rrd_first(argc - 1, &argv[1]));
+@@ -753,7 +753,7 @@
+ printf("%20s", ds_namv[i]);
+ printf("\n\n");
+ for (ti = start + step; ti <= end; ti += step) {
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf("%10llu:", ti);
+ #else
+ printf("%10lu:", ti);