"sel info" : remove 2-space indent, print actual timestamps

This commit is contained in:
Duncan Laurie 2004-03-03 22:25:56 +00:00
parent 706bb54764
commit 0710a0a98e

View File

@ -80,6 +80,33 @@ ipmi_get_event_type(unsigned char code)
return "Reserved";
}
static char *
ipmi_sel_timestamp(uint32_t stamp)
{
static unsigned char tbuf[40];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&s));
return tbuf;
}
static char *
ipmi_sel_timestamp_date(uint32_t stamp)
{
static unsigned char tbuf[11];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y", localtime(&s));
return tbuf;
}
static char *
ipmi_sel_timestamp_time(uint32_t stamp)
{
static unsigned char tbuf[9];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&s));
return tbuf;
}
static void
ipmi_get_event_desc(struct sel_event_record * rec, char ** desc)
{
@ -151,10 +178,10 @@ ipmi_sel_get_info(struct ipmi_intf * intf)
buf2short(rsp->data + 1));
printf("Free Space : %d\n",
buf2short(rsp->data + 3));
printf(" Last Add Time : %08lx\n",
buf2long(rsp->data + 5));
printf(" Last Del Time : %08lx\n",
buf2long(rsp->data + 9));
printf("Last Add Time : %s\n",
ipmi_sel_timestamp(buf2long(rsp->data + 5)));
printf("Last Del Time : %s\n",
ipmi_sel_timestamp(buf2long(rsp->data + 9)));
printf("Overflow : %s\n",
rsp->data[13] & 0x80 ? "true" : "false");
printf("Delete cmd : %ssupported\n",
@ -241,33 +268,6 @@ ipmi_sel_get_std_entry(struct ipmi_intf * intf, unsigned short id, struct sel_ev
return (rsp->data[1] << 8) | rsp->data[0];
}
static char *
ipmi_sel_timestamp(uint32_t stamp)
{
static unsigned char tbuf[40];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&s));
return tbuf;
}
static char *
ipmi_sel_timestamp_date(uint32_t stamp)
{
static unsigned char tbuf[11];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y", localtime(&s));
return tbuf;
}
static char *
ipmi_sel_timestamp_time(uint32_t stamp)
{
static unsigned char tbuf[9];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&s));
return tbuf;
}
void
ipmi_sel_print_std_entry(struct sel_event_record * evt)
{