fru: Fix processing of unspecified board mfg. date

FRU board mfg. date uses a different value for 'unspecified'
timestamp than the general IPMI specification.

This commit makes ekanalyzer and fru commands process unspecified
FRU dates properly, displaying 'Unspecified' instead of
'Mon Jan  1 03:00:00 1996'.

Resolves ipmitool/ipmitool#57

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
Alexander Amelkin
2018-11-16 22:21:14 +03:00
parent 576d4855d9
commit a4c1040420
2 changed files with 19 additions and 2 deletions

View File

@@ -2546,7 +2546,11 @@ ipmi_ek_display_fru_header_detail(char *filename)
}
ts = ipmi_fru2time_t(mfg_date);
printf("Board Mfg Date: %ld, %s\n", ts, ipmi_timestamp_numeric(ts));
printf("Board Mfg Date: %ld, %s\n",
(IPMI_TIME_UNSPECIFIED == ts)
? FRU_BOARD_DATE_UNSPEC
: ts,
ipmi_timestamp_numeric(ts));
board_length -= SIZE_MFG_DATE;
/* Board Mfg */