break down ccode on error

This commit is contained in:
Duncan Laurie 2004-11-17 23:11:59 +00:00
parent 1cf302c89e
commit 6cdcd8555a

View File

@ -247,8 +247,15 @@ static void ipmi_chassis_status(struct ipmi_intf * intf)
req.msg.cmd = 0x1;
rsp = intf->sendrecv(intf, &req);
if (!rsp || rsp->ccode)
if (!rsp) {
printf("Error sending Chassis Status command\n");
return;
}
if (rsp->ccode > 0) {
printf("Error sending Chassis Status command: %s\n",
val2str(rsp->ccode, completion_code_vals));
return;
}
/* byte 1 */
printf("System Power : %s\n", (rsp->data[0] & 0x1) ? "on" : "off");