mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
handle empty SEL gracefully when doing "sel list"
This commit is contained in:
parent
05df8eb9a2
commit
4de32a37e8
@ -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 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user