From: Duncan L. <ice...@us...> - 2004-04-16 00:14:27
|
Update of /cvsroot/ipmitool/ipmitool/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26482/lib Modified Files: ipmi_chassis.c Log Message: fix chassis power control, it needs admin privlvl Index: ipmi_chassis.c =================================================================== RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_chassis.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ipmi_chassis.c 15 Apr 2004 20:29:26 -0000 1.5 --- ipmi_chassis.c 16 Apr 2004 00:14:18 -0000 1.6 *************** *** 79,84 **** --- 79,87 ---- static void ipmi_chassis_power_control(struct ipmi_intf * intf, unsigned char ctl) { + struct ipmi_rs * rsp; struct ipmi_rq req; + ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN); + memset(&req, 0, sizeof(req)); req.msg.netfn = IPMI_NETFN_CHASSIS; *************** *** 87,95 **** req.msg.data_len = 1; ! printf("Chassis Power Control: %s\n", ! val2str(ctl, ipmi_chassis_power_control_vals)); ! intf->sendrecv(intf, &req); ! intf->abort = 1; } --- 90,103 ---- req.msg.data_len = 1; ! rsp = intf->sendrecv(intf, &req); ! if (!rsp || rsp->ccode) { ! printf("Unable to set Chassis Power Control to %s\n", ! val2str(ctl, ipmi_chassis_power_control_vals)); ! } else { ! printf("Chassis Power Control: %s\n", ! val2str(ctl, ipmi_chassis_power_control_vals)); ! intf->abort = 1; ! } } |