]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fix lastupdate time in dump (32bit MSVC only) 894/head
authorWolfgang Stöggl <c72578@yahoo.de>
Sat, 14 Jul 2018 12:31:06 +0000 (14:31 +0200)
committerWolfgang Stöggl <c72578@yahoo.de>
Sat, 14 Jul 2018 12:31:06 +0000 (14:31 +0200)
- So far, (null) was written into the lastupdate time string:
  e.g.: <lastupdate>1511170870</lastupdate> <!-- (null) -->
- The problem occurred only in 32bit MSVC builds
- Works for both, with or without _USE_32BIT_TIME_T

src/rrd_dump.c

index 9412a8f12f5846dfa3f24f9ce5ff2c66304c99c6..514328ab68a3ecb3a836191f04ad8ed80ec3480e 100644 (file)
@@ -129,8 +129,15 @@ int rrd_dump_cb_r(
 #else
 # error "Need strftime"
 #endif
+#if defined (_MSC_VER) && (_M_IX86)
+/* Otherwise (null) will be written to %s when compiling for 32-bit using MSVC */
+/* works for both, with or without _USE_32BIT_TIME_T */
+    CB_FMTS("\t<lastupdate>%ld</lastupdate> <!-- %s -->\n\n",
+        (long int) rrd.live_head->last_up, somestring);
+#else
     CB_FMTS("\t<lastupdate>%lld</lastupdate> <!-- %s -->\n\n",
         (long long int) rrd.live_head->last_up, somestring);
+#endif
     for (i = 0; i < rrd.stat_head->ds_cnt; i++) {
         CB_PUTS("\t<ds>\n");