mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID: 3603419 - 'lib/ipmi_dcmi.c' - waste of resources
Commit moves one #ifdef upwards in the code, so resources are not wasted pointlessly. There is no need to allocate memory for variables/structs and open interface, if we're about to quit immediately because LAN+ support is not enabled. Error message got changed as well and it gets printed on STDERR where it belongs!
This commit is contained in:
parent
db56cc3f86
commit
39ad0d62cc
@ -445,6 +445,11 @@ void display_capabilities_attributes(
|
||||
static int
|
||||
ipmi_dcmi_prnt_oobDiscover(struct ipmi_intf * intf)
|
||||
{
|
||||
# ifndef IPMI_INTF_LANPLUS
|
||||
lprintf(LOG_ERR,
|
||||
"DCMI Discovery is available only when LANplus(IPMI v2.0) is enabled.");
|
||||
return (-1);
|
||||
# else
|
||||
int rc;
|
||||
|
||||
if (intf->opened == 0 && intf->open != NULL) {
|
||||
@ -452,11 +457,6 @@ ipmi_dcmi_prnt_oobDiscover(struct ipmi_intf * intf)
|
||||
return (int) NULL;
|
||||
}
|
||||
|
||||
#ifndef IPMI_INTF_LANPLUS
|
||||
printf("Function oobDicover unavailable when lanplus (IPMI v2) is not enabled\n");
|
||||
return -1;
|
||||
|
||||
#else
|
||||
|
||||
struct ipmi_session *s;
|
||||
|
||||
@ -520,7 +520,7 @@ ipmi_dcmi_prnt_oobDiscover(struct ipmi_intf * intf)
|
||||
|
||||
//Lets ping/pong
|
||||
return ipmiv2_lan_ping(intf);
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
/*******************************************************************************
|
||||
* This is the get DCMI Capabilities function to see what the BMC supports. *
|
||||
|
Loading…
x
Reference in New Issue
Block a user