handle empty SEL gracefully when doing "sel list"

This commit is contained in:
Duncan Laurie 2003-11-26 19:11:52 +00:00
parent 05df8eb9a2
commit 4de32a37e8

View File

@ -324,6 +324,24 @@ ipmi_sel_list_entries(struct ipmi_intf * intf)
int num = 1; int num = 1;
struct sel_event_record * evt; struct sel_event_record * evt;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = 0x40;
rsp = intf->sendrecv(intf, &req);
if (!rsp || rsp->ccode) {
printf("Error%x in Get SEL Info command\n",
rsp ? rsp->ccode : 0);
return;
}
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "sel_info");
if (!rsp->data[1]) {
printf("SEL has no entries\n");
return;
}
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE; req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = 0x42; /* reserve SEL */ req.msg.cmd = 0x42; /* reserve SEL */