ports/net/rrdtool/patches/patch-src_rrd_tool_c

40 lines
1.8 KiB
Text

Correctly print time_t.
Index: src/rrd_tool.c
--- src/rrd_tool.c.orig
+++ src/rrd_tool.c
@@ -723,19 +723,11 @@ static int HandleInputLine(
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) */
- printf("%lld\n", rrd_last(argc - 1, &argv[1]));
-#else
- printf("%ld\n", rrd_last(argc - 1, &argv[1]));
-#endif
+ printf("%lld\n", (long long)rrd_last(argc - 1, &argv[1]));
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) */
- printf("%lld\n", rrd_first(argc - 1, &argv[1]));
-#else
- printf("%ld\n", rrd_first(argc - 1, &argv[1]));
-#endif
+ printf("%lld\n", (long long)rrd_first(argc - 1, &argv[1]));
else if (strcmp("update", argv[1]) == 0)
rrd_update(argc - 1, &argv[1]);
else if (strcmp("fetch", argv[1]) == 0) {
@@ -753,11 +745,7 @@ static int HandleInputLine(
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) */
- printf("%10llu:", ti);
-#else
- printf("%10lu:", ti);
-#endif
+ printf("%10llu:", (long long)ti);
for (ii = 0; ii < ds_cnt; ii++)
printf(" %0.10e", *(datai++));
printf("\n");