Follow-up Comment #1, bug #38799 (project freeipmi):
Here's a patch for one instance of this problem. A more generic IPMI
timestamp display function should be created and used through-out the
IPMI/DCMI code to address this problem globally:
Index: bmc-device/bmc-device.c
===
--- bmc-device/bmc-device.c (revision 9608)
+++ bmc-device/bmc-device.c (working copy)
@@ -1274,15 +1274,26 @@
goto cleanup;
}
- /* Posix says individual calls need not clear/set all portions of
- * 'struct tm', thus passing 'struct tm' between functions could
- * have issues. So we need to memset.
- */
- memset (tm, ' ', sizeof(struct tm));
+/* Per IPMI 2.0 section 37.1: */
+#define IPMI_TIMESTAMP_UNSPECIFIED 0x
+#define IPMI_TIMESTAMP_POST_INIT0x2000
+ if (val == IPMI_TIMESTAMP_UNSPECIFIED)
+snprintf (timestr, sizeof (timestr), Unspecified);
+ else if (val = IPMI_TIMESTAMP_POST_INIT)
+snprintf (timestr, sizeof (timestr), %u seconds since initialization,
(unsigned)val);
+ else
+{
+ /* Posix says individual calls need not clear/set all portions of
+ * 'struct tm', thus passing 'struct tm' between functions could
+ * have issues. So we need to memset.
+ */
+ memset (tm, ' ', sizeof(struct tm));
- t = val;
- localtime_r (t, tm);
- strftime (timestr, sizeof (timestr), %m/%d/%Y - %H:%M:%S, tm);
+ t = val;
+ localtime_r (t, tm);
+ strftime (timestr, sizeof (timestr), %m/%d/%Y - %H:%M:%S, tm);
+}
+
pstdout_printf (state_data-pstate,
SEL Time : %sn,
timestr);
___
Reply to this item at:
http://savannah.gnu.org/bugs/?38799
___
Message sent via/by Savannah
http://savannah.gnu.org/
___
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/freeipmi-devel