代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/ipmitool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ecb4cfbff855bb24099f2a80a6dd558518702c7d Mon Sep 17 00:00:00 2001
From: srinivasa_mareedu <srinivasa_mareedu@dell.com>
Date: Mon, 23 Jan 2017 16:41:09 +0530
Subject: [PATCH 019/119] ID:472 - Fix The Most recent Addition/Erase date
Fix the Most recent Addition/Erase date are not matched between in-band and
out-band.
ipmitool SDR code doesn't have to check for valid date to print
based on 'Delete SDR command supported' and 'Partial Add SDR command
supported', if 0xffffffff is taken. Also 'Timestamp' data type needs to change
to time_t(long) because same data type is using for gmtime(time_t) API, it has
different behaviour for Linux and Windows C.
---
lib/ipmi_sdr.c | 64 ++++++++++++++++++++++++++++++++++++--------------
1 file changed, 47 insertions(+), 17 deletions(-)
diff --git a/lib/ipmi_sdr.c b/lib/ipmi_sdr.c
index 2a9cbe3..167c252 100644
--- a/lib/ipmi_sdr.c
+++ b/lib/ipmi_sdr.c
@@ -4217,7 +4217,7 @@ ipmi_sdr_get_info(struct ipmi_intf *intf,
* returns pointer to static buffer
*/
static char *
-ipmi_sdr_timestamp(uint32_t stamp)
+ipmi_sdr_timestamp(time_t stamp)
{
static char tbuf[40];
time_t s = (time_t) stamp;
@@ -4240,7 +4240,7 @@ ipmi_sdr_timestamp(uint32_t stamp)
int
ipmi_sdr_print_info(struct ipmi_intf *intf)
{
- uint32_t timestamp;
+ time_t timestamp;
uint16_t free_space;
struct get_sdr_repository_info_rsp sdr_repository_info;
@@ -4274,21 +4274,51 @@ ipmi_sdr_print_info(struct ipmi_intf *intf)
break;
}
- timestamp =
- (sdr_repository_info.most_recent_addition_timestamp[3] << 24) |
- (sdr_repository_info.most_recent_addition_timestamp[2] << 16) |
- (sdr_repository_info.most_recent_addition_timestamp[1] << 8) |
- sdr_repository_info.most_recent_addition_timestamp[0];
- printf("Most recent Addition : %s\n",
- ipmi_sdr_timestamp(timestamp));
-
- timestamp =
- (sdr_repository_info.most_recent_erase_timestamp[3] << 24) |
- (sdr_repository_info.most_recent_erase_timestamp[2] << 16) |
- (sdr_repository_info.most_recent_erase_timestamp[1] << 8) |
- sdr_repository_info.most_recent_erase_timestamp[0];
- printf("Most recent Erase : %s\n",
- ipmi_sdr_timestamp(timestamp));
+ if(sdr_repository_info.delete_sdr_supported && sdr_repository_info.partial_add_sdr_supported)
+ {
+ timestamp =
+ (sdr_repository_info.most_recent_addition_timestamp[3] << 24) |
+ (sdr_repository_info.most_recent_addition_timestamp[2] << 16) |
+ (sdr_repository_info.most_recent_addition_timestamp[1] << 8) |
+ sdr_repository_info.most_recent_addition_timestamp[0];
+ printf("Most recent Addition : %s\n",
+ ipmi_sdr_timestamp(timestamp));
+
+ timestamp =
+ (sdr_repository_info.most_recent_erase_timestamp[3] << 24) |
+ (sdr_repository_info.most_recent_erase_timestamp[2] << 16) |
+ (sdr_repository_info.most_recent_erase_timestamp[1] << 8) |
+ sdr_repository_info.most_recent_erase_timestamp[0];
+ printf("Most recent Erase : %s\n",
+ ipmi_sdr_timestamp(timestamp));
+ }
+ else if (sdr_repository_info.partial_add_sdr_supported)
+ {
+ timestamp =
+ (sdr_repository_info.most_recent_addition_timestamp[3] << 24) |
+ (sdr_repository_info.most_recent_addition_timestamp[2] << 16) |
+ (sdr_repository_info.most_recent_addition_timestamp[1] << 8) |
+ sdr_repository_info.most_recent_addition_timestamp[0];
+ printf("Most recent Addition : %s\n",
+ ipmi_sdr_timestamp(timestamp));
+ printf("Most recent Erase : NA\n");
+ }
+ else if(sdr_repository_info.delete_sdr_supported)
+ {
+ printf("Most recent Addition : NA\n");
+ timestamp =
+ (sdr_repository_info.most_recent_erase_timestamp[3] << 24) |
+ (sdr_repository_info.most_recent_erase_timestamp[2] << 16) |
+ (sdr_repository_info.most_recent_erase_timestamp[1] << 8) |
+ sdr_repository_info.most_recent_erase_timestamp[0];
+ printf("Most recent Erase : %s\n",
+ ipmi_sdr_timestamp(timestamp));
+ }
+ else
+ {
+ printf("Most recent Addition : NA\n");
+ printf("Most recent Erase : NA\n");
+ }
printf("SDR overflow : %s\n",
(sdr_repository_info.overflow_flag ? "yes" : "no"));
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。